bug: http request callback fires twice on error

Prevents http connection errors from executing the error
callback two times, and adds a test.