Adds NULL check and style cleanup

* Adds check for mExtraHeaders == NULL to all allExtraHeadersNames()
* Makes mExtraHeaders == NULL checks more consistent
* Cleans up code formatting to be more consistent