codec: Correct long standing hack

The PalmDocCodec has had a 'quick hack' present in form of assuming that
we're at the end of the stream when encountering a zero byte during
decompression.

The problem was caused by not trimming the text record of its trailing
entries. This commit corrects the behaviour of the Codec ready for text
record extraction to come in a later patch.