I read recently, that sometimes in order to fill the boiler they had to run the locomotive backwards and forwards in the yard to pump water into the system.
You're right though, could be a potentially dangerous situation where a crosshead pump failed.
For all that, boiler explosions were rare.