MULE-8018: Merge http connector code cleanup

Duplicate of previuos comment: https://github.com/mulesoft/mule/pull/1163#discussion-diff-20290687R15