Better error handling in list_locks()

Signed-off-by: Zack Cerza <zack.cerza@inktank.com>