Fix some concurrency issues with script caching in Gremlin Extension.

Should correct #339.