Fix locking for _properties initialization

The check if _properties collection is initialized should happen inside the lock.
Merge pull request #1 from kshapkin/master

Fix locking for _properties initialization