Fix for race condition. When masterha_manager is stopped but daemon hasn't been stopped yet, then the daemon restarts masterha_manager