Hartree-Fock-Bogoliubov mass formulas and the equation of state of neutron-star matter