#14062: fix BytesParser handling of Header objects

This is a different fix than the 3.2 fix, but the new tests are the same.

This also affected smtplib.SMTP.send_message, which calls BytesParser.
diff --git a/Lib/email/generator.py b/Lib/email/generator.py
index d8b8fa9..edba13f 100644
--- a/Lib/email/generator.py
+++ b/Lib/email/generator.py
@@ -386,6 +386,9 @@
                     h = Header(v, charset=_charset.UNKNOWN8BIT, header_name=h)
                 else:
                     h = Header(v, header_name=h)
+            else:
+                # Assume it is a Header-like object.
+                h = v
             self.write(h.encode(linesep=self._NL,
                                 maxlinelen=self._maxheaderlen)+self._NL)
         # A blank line always separates headers from body