Add frontend alive check to the backend.

Stop the backend if the frontend process does not exist any more and
backend is not a daemon.