Fixed possible deadlock in TypeCache