When writing MimeMessages, merge message and body headers sorted by Offset

This is to preserve message and content header ordering which is needed
when cryptograpjically verifying digital signatures.