apr_memcache: custom version with locks issues solved

Got lot of lock issues while using original version you provided in git repo.
This one is running more than 1 year without problems.