change client loop polling into condition variable

1. remove loop in lock client and replace with server-side
   condition variable

2. now the rpc amount has been reduced to exactly 150