This commit fixes 3 issues: 1) In some cases, the hash ratchet was not correctly found 2) Out of order messages were not processed correctly as the wrong error was returned 3) Batched non datasync messages were not processed correctly Fixes: #4170