Ensure close() is always called even for HEAD requests