Add a check for corrupt (empty) locks and throw a better error

My battery got tired and then my SSD forgot what it was doing and then my opam exploded.