Fix NULL dereference when CTLineCreateTruncatedLine fails and returns a NULL

Fixes #817.