Wait half a second before shutting down

This allows subsequent requests to come in, e.g. if the user reloaded the page.
This is tricker than you might expect because the Flask dev server can only be shut down from a request handler.

Fixes #10