[CoreText] Fix PDF handling in end of string

The CoreText backend will remove the PDF token from the end of
the string (instead of producing a zero-width glyph for it),
thus the output will be different from the OpenType backend
and the client will get confused. To fix this, we emulate the
expected behavior by molding the output in a special case.

Based on patch from Eskil Abrahamsen Blomfeldt