Revert "Fix lock handling in memory hander of nscd."