zookeeper: Gracefully close connection when app is shutting down.

This should help reduce logspam on the zookeeper ensemble.

The `on_app_shutdown` function is intended for use in gunicorn's
`worker_exit` hook.