Replace http.ListenAndServe with http.Server and signal handling to
support graceful shutdown. On SIGTERM or SIGINT, the server drains
in-flight requests with a 15-second timeout before exiting cleanly.
This prevents dropped connections during Kubernetes pod termination.
Closesleeworks-agents/gitea-mobile#201
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>