Moves lock check to AllowedToCompleteInCurrentFile function.