NEXUS-5595: Keep and hold lock instance.

As due how UIDs and locks are implemented in Nexus,
they might be GCed and finally block might end up with
differnt lock instance.

This code was just bad