Tidy up potential race condition on hangup, restart of application