MAM: Improve MAM efficiency

This looks at all messages incoming and saves the stanza-id if there is one.
Previously this was only done for messages of type=chat, which left out muc invites
and captcha messages, leading to fetching these messages later again.
3 jobs for master in 2 minutes and 41 seconds (queued for 3 seconds)
Status Job ID Name Coverage
  Test
passed #12626
run-appdata

00:00:07

failed #12625
run-tests

00:02:33

 
  Build
skipped #12627
run-build
 
Name Stage Failure
failed
run-tests Test
Unable to init server: Could not connect: Connection refused
Unable to init server: Could not connect: Connection refused
************* Module gajim.common.modules.message
gajim/common/modules/message.py:29:0: W0611: Unused muc_caps_cache imported from gajim.common.caps_cache (unused-import)

--------------------------------------------------------------------
Your code has been rated at 10.00/10 (previous run: 10.00/10, -0.00)

ERROR: Job failed: exit status 1