make sure headers is set prior to accessing

We have a fallback Null Transport agent and get the following error if it used when logging is enabled.

[Elastica\Exception\InvalidException] Config key is not set: headers 

PR resolves this issue.