Protect against non-arrays when fetching headers

PHP documentation says this can theoretically return false on failure.

HHVM actually returns null when running from the command line, so
this does protect against that.

Change-Id: I0d75b8ed209128a9667ce1e7189597ae9ebc8af6
Merge "Protect against non-arrays when fetching headers"