Cancel handlers when losing connections; refactor `gunicorn`.