Comparing transverse momentum balance of b jet pairs in pp and PbPb collisions at $\sqrt{s_\mathrm{NN}} =$ 5.02 TeV