Fix for NPE in debug logging statement
Explicitly close request when everything is done

Otherwise connections may be not released, especially when request fails (e.g. HTTP 404)