Added proxy object when smartpointers -> operator is used. This proxy object
is used for thread safety as it locks the object mutex on constructor
and unlocks it on destruction.