Johan Hagemeyer, Prison