IMAPMessage loadContent() and writeTo() fixes. Test code based on patch from Andreas Veithen (GERONIMO-4352)