Fixes sys.stderr if gunicorns LazyWriter is used

Fix for gunicorn's LazyWriter