Fix: Cannot read property 'headers' of undefined

Occasionally, you will get "Cannot read property 'headers' of undefined" when trying to request a header. It's randomly crashing my daemon - I assume when I get a null response from a server.

This does a couple of extra checks.