Moved the application lock server socket to the locking thread