Exit the process after master elected process exits

When schema transformer raises an exception, the lock file is deleted (as Lock.__exit__() gets called and lock file is removed in _inner_release). This would cause other node to become master. Due to the while loop in master election, current process continues to run and ports remain open..