Fixed incorrect return value for _encodeHeaders:error:

Fixed _encodeHeaders:error: can return YES (success) on failure when the out error provided is nil