mutex for quit/heartbeat in master