[LockManager] Added timeout to the lock() function.

Change-Id: I32f97b813fc6036b2774d67c14c574420e7a1437
Merge "[LockManager] Added timeout to the lock() function."