Wait for lock file to be removed before exiting