Add optional locking to the lock server