Merge pull request #657 from jbevain-forks/thread-safe-cs-code-generator