Improve the append message to mailbox in IMAP server.

Add support for set the appending message's flag.
Add support for APPENDUID command (RFC 4315) which return the appended message's uid to the caller.