Threadsafety

This PR addresses two concurrency issues we've identified by trying to compile Sass using JRuby where requests are handled by threads instead of processes. I've also created a small framework for running scripts that can be used to reproduce threadsafety issues.

This patch adds a dependency on the `thread_safe` gem so that we can use the `ThreadSafe::Cache` class.

This fixes #799.