XEP-0198: Fix incoming stanza count

We failed to call the update_num_stanzas_in() function in certain cases.

THIS COMMIT IS MEANT TO BE SQUASHED INTO THE PREVIOUS ONE WHEN THE
HISTORY OF THIS FEATURE BRANCH IS REWRITTEN.
XEP-0198: Improve handling of a corner case

Check the requested stream management version *before* checking whether
the "stream_management" option is enabled.

THIS COMMIT IS MEANT TO BE SQUASHED INTO THE PREVIOUS ONE WHEN THE
HISTORY OF THIS FEATURE BRANCH IS REWRITTEN.
XEP-0198: Cosmetic changes

Apply a few cosmetic changes to the XEP-0198 code.

THIS COMMIT IS MEANT TO BE SQUASHED INTO THE PREVIOUS ONE WHEN THE
HISTORY OF THIS FEATURE BRANCH IS REWRITTEN.
Remove some commented out code

The code that had been commented out at some earlier point in time would
now break XEP-0198.
XEP-0198: Support session resumption

Add support for the optional session resumption feature described in
XEP-0198.  A client that supports this feature may now resume the
previous session (within a configurable number of seconds) if the
connection was lost.  During resumption, ejabberd will retransmit any
stanzas that hadn't been acknowledged by the client.
XEP-0198: Bounce unacked stanzas by default

If the new "resend_on_timeout" option is set to "false" (which it is by
default), bounce any unacknowledged stanzas instead of re-routing them.