various bug fixes
resolve error in cleanup of shared resources
call EG as little as possible in critical places, avoid incurring those locks
use internal pthreads api for lock/unlock when writing annonymous members
resolve leaks from removing object cache
remove uneeded element from PTHREAD