redo exit handler a bit

Allows for write_status(code, True)