Mountain Lion reinstall failure
It turns out that for some Macbook Pros, it is common for the internal SATA cable to start malfunctioning over time. The errors I experienced does not give a clear indication that this is the case but if others come across this thread and experience spurious installation errors then here are three different ways of getting a Macbook Pro running again:


Connect hard drive via USB/SATA, cost ~12$ and easy but cumbersome to
have the drive dangling around, so mostly useful for debugging and
determining that it is the internal SATA cable that is
malfunctioning.
Connect hard drive via optical drive caddy, cost ~12$, installation
guide
https://www.ifixit.com/Guide/Installing+MacBook+Pro+13-Inch+Unibody+Early+2011+Dual+Hard+Drive/8529
Replace the internal SATA cable, cost ~40$, installation
guide:
https://www.ifixit.com/Guide/MacBook+Pro+13-Inch+Unibody+Mid+2012+Hard+Drive+Cable+Replacement/10379