Replace brittle timeout with a background heartbeat thread

@thieman 


Because... we are scared it will never exit?