Constraints on abelian extensions of the Standard Model from two-loop vacuum stability and U(1)B−L