Added watchdog thread to listen for heartbeat timeouts.