Fixed decoding in the case of fragmented delimiters #3306

- also improved tests to test more edge cases

I am not sure if it fixes the one-byte case, but it will fix the others.