Use middleware to release the database connection after each request

Without this, Active Record's pool of database connections gets exhausted
after a certain number of requests.
Write an acceptance test for /404 URLs

We don't have to implement anything new to make this work.
Return 410 responses to /410 URLs