Put killing of pid in an ensure block