Make DefinitionCache thread safe

There could be a thread switch in between the call to containsKey() and the call to get()
Merge pull request #1 from Strikeskids/patch-1

Make DefinitionCache thread safe