tree: preallocate memory for all TreeItemMessage instances during the mailbox sync

There is no measurable performance change on my test setup, which is expected --
the amortized cost of reallocating is still O(1) per element, i.e. O(n) for the
mailbox as a whole, and pointer copying is dwarfed by the overhead of dynamic
allocation of the actual nodes and other useful work, but it's still good style
to preallocate what is known to be needed in future.

Thanks to Thomas Lübking for suggesting this.

REVIEW: 114124
GUI: Save state of menu bar between launches

REVIEW: 114177
GUI: make sure that all actions are reachable even when the menu is hidden

The action has to be added to a visible widget if we want the shortcuts to work.
The menu had an option for hiding for quite some time, but a hidden menu
apparently stops these shortcuts from working. As a workaround, we can easily
add the actions directly to the main widget.

v2: Move the add-action-to-widget code to the place where they're getting added
to the menu, and be sure it's unified into a single macro. Also remove extra
addAction calls where they are not needed.

REVIEW: 114183
IMAP: fix QRESYNC when the mailbox was previously empty

The code must know that QRESYNC was issued, otherwise it (correctly) refuses to
deal with FETCH messages which attempt to reference the "unknown" messages.

Thansk to Stephan Platz (paalsteek on IRC) for an excellent report.
Sender address is editable.

Free form editing of the FromAddress is possible, and saving/loading drafts
with a custom FromAddress works.

A huge thanks to Stephan Platz (paalsteek) for his patch. This commit is built
upon that very patch.

BUG: 321230
Sender LineEdit turns red for invalid address.
Add proper credits for Stephan and Jai
Other visual changes to attachments

REVIEW: 114188
IMAP: fix a bug when opening folders when offline after a STATUS arrived

By definition, the mailboxes are synchronized when they are opened. When all
whic his needed is just the number of e.g. unread/total messages, a lightweight
variant of syncing is performed through the STATUS command. The STATUS data are
displayed in the GUI, but they are not cached. Unfortunately, they also managed
to interfere with opening the mailbox from a locally cached copy when offline.

This change makes sure that the only "cache consistency check" which is
performed happens on top of the cached data, i.e. the UID mapping and the
synchronization state. What has in the meanwhile arrived via STATUS is
completely irrelevant and should not affect the synchronization process (we do
not even know whether some messages were deleted, so it is impossible to show
e.g. a couple (status_exists - old_exists) empty placeholder messages, etc).

I guess it's very handy that I travel on train every now and then :).

REVIEW: 114225
tree: do not try to insert -1 rows

Thanks to the KDE CI infrastructure for catching this -- it is a bug and Qt's
asserts guard against it.
build: enable warnings about signed-unsigned compare and fix one problem in tests

This is enabled on Qt5 by default, apparently, so it never hurts to have it
always active.
build: add options for -Werror to the CI

When cmake is run with -DDEV_FATAL_WARNINGS=ON, all warnings are turned into
errors. The idea is that Trojita compiles warning-free, and it shall remain so.

This is, however, *not* enabled for the end-user builds because experience of a
ton of other projects shows that sooner or later a compiler will come up with a
new, incompatible diagnostics which simply breaks everything.
Add missing credits to Benjamin Kaiser
travis: disable -Werror on clang and Qt4

Otherwise, the build fails with the following error message:

/usr/include/qt4/QtCore/qsharedpointer_impl.h:595:43: error: field 'd' is
      uninitialized when used here [-Werror,-Wuninitialized]
    inline QWeakPointer(X *ptr) : d(ptr ? d->getAndRef(ptr) : 0), value(ptr)
                                          ^