Bug 854048 - Fix batch move/deletion for IMAP messages

r? @asutherland: This fixes batch move/deletion ops for IMAP, and has tests which fail pre-fix and pass post-fix. I also added the same "refresh the source/target folders once online" test to the non-batch move/delete test case, just for thoroughness.

https://bugzilla.mozilla.org/show_bug.cgi?id=854048