Synchronize access to `Names` in the presentation compiler.

This may lead to subtle errors, like the mysterious
assertion error in pickler.

Refs #1001607, #1001606
Merge pull request #422 from dragos/issue/synchronize-name-access

Synchronize access to `Names` in the presentation compiler.