fixed uid lock may not be released in some cases

Signed-off-by: Igor Fedorenko <igor@ifedorenko.com>