Reverted removal of fcntl call.

Also made it only happen when it is being run as a dedicated server.