Disable threadsafe! mode in production environments when running raks tasks

Rake tasks cannot access models when threadsafe mode is enabled. Rake sets a global variable that can be checked to disable threadsafe mode when running tasks.

See: https://github.com/rails/rails/issues/2662

Change:
    ```config.threadsafe!```
To:
    ```config.threadsafe! unless $rails_rake_task```