Corrected order of invalidating and freeing lock structure.
Improved ULDB unit-test w.r.t. valgrind(1).


Added suppressions and missing free()ings.