Fix for write_stats error when using threads pool.  Closes #1631
Merge branch 'master' into 3.1
Django: Fixed typo @celery.task -> @app.task
Use @app.task consistently
Windows: Do not show maxtasks warning.  Closes #1630