implemented lock on memcached.c