Fix build warnings

clang 3.4 says error: 'register' storage class specifier is deprecated
[-Werror,-Wdeprecated-register], and it's right.

It also says that src/Imap/Parser/3rdparty/rfccodecs.cpp:58:19: error:
unused variable 'especials' [-Werror,-Wunused-const-variable], and it
happens to be right in this case, too.

Change-Id: I67b04db1a3251c8a123c5b1aaafb7b4fed84c408
clang: Silence warning about Ragel's unused variables

It seems that some of these variables could be disabled, but I found no
trace of the _en_main. Here are the original warnings:

Rfc5322HeaderParser.generated.cpp:2534:18: warning: unused variable 'rfc5322_first_final' [-Wunused-const-variable]
Rfc5322HeaderParser.generated.cpp:2535:18: warning: unused variable 'rfc5322_error' [-Wunused-const-variable]
Rfc5322HeaderParser.generated.cpp:2537:18: warning: unused variable 'rfc5322_en_main' [-Wunused-const-variable]

Change-Id: I4ac825832c47ac23c717b0659c269d92600d2013
Fix build failure with GCC

Turns out that GCC warns about pragmas it doesn't recognize. That's of
course very cool, but what's rather uncool is that it treats pragmas for
other compilers as warnings. That complicates the code quite a bit :(.

And of course, GCC explodes on #if defined(__has_warning) &&
__has_warning("-Wunused-const-variable") for increased fun.

Change-Id: I132b86265d55d253c58183610b1c078b6d434ddf
Prevent dereferencing of invalid iterator

This cannot happen in real world (the parser will send at least some
event during the process of logging out), but it's nonetheless a good
idea to be defensive from this context. It's quite possible that a
future change could add support for limiting the number of events which
are logged, and at that point we would have a problem. So better safe
than sorry here -- it's bad to rely on an assumption which is vague at
best.

Change-Id: I3ddfb4bed312f2e9d5e64588f9e5a5dca81d7d91
Emit signals properly when going offline

The wrapper function exists for a reason; without this patch, the
connection status was not updated correctly, and the GUI was leaving old
protocol loggers behind.

Change-Id: I8cca940ac5f498440e0326c2a502dc5166602833
Announce dropped connections as switching to LOGOUT

The CONN_STATE_LOGOUT is what the GUI's protocol loggers are looking for
during the check for throwing old logs away.

Change-Id: I1a90bf29a4b8b677fb7e3c6e63a33bf937879e08