[JumpThreading] Factor out code to merge basic blocks (NFC)
This patch factors out code to merge a basic block with its sole
successor -- partly for readability and partly to facilitate an
upcoming patch of my own.
Subscribers: hiraditya, jfb, llvm-commits
Differential Revision: https://reviews.llvm.org/D69852