client: add helper function that updates lock state

Signed-off-by: Yan, Zheng <zyan@redhat.com>