lock-hash: non-blocking operation and peeking

Signed-off-by: Jan Dvořák <mordae@anilinux.org>