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.
Merge pull request #1 from unclespode/patch-2

Fix: Cannot read property 'headers' of undefined