Configurable drain timeout for closing database connections during shutdown

Problem

Currently, when the app is shutting down, we wait for the inflight HTTP API requests to complete, up to a duration of http.draintimeout, and then continue the shutdown process. Then we try to close database connections, but here we're waiting indefinitely instead of limited to a configurable amount of time.

Solution

Expose a new database.draintimeout configuration parameter and use that to enforce a deadline for draining existing connections before exiting.

Related to !384 (comment 432755158).

Edited by João Pereira