Fix exception when dying in a different world from the bed.