Handle pending messages on message initialization (and some other fixes)
requested to merge jezekchicki/nuntium:handle-pending-messages-on-initialization into ubports/xenial
This MR should help to recover from message handling errors, especially the endless spinning wheel bug whis happens sometimes, discussed in forum ([1], [2]).
This MR also contains some other fixes and code improvements, described in commit descriptions.
This MR also contains the commit from MR !15 (closed)