imap: avoid copying partial buffer on append