XEP-0198: Gracefully handle wrong credentials

Produce a proper error message instead of crashing when the JID encoded
in the 'previd' value of a <resume/> request is different from the
authenticated JID.
XEP-0198: Gracefully handle broken 'previd'

Produce a proper error message instead of crashing when the 'previd'
value of a <resume/> request has an unexpected format.