Cleaner shutdown of HTTP client