fdo#77308: SwFormTokensHelper avoid infinite loop on invalid input

In 4.1 this loops because the input is truncated to 64k length; try to
avoid looping when the input is invalid and the terminating ">" cannot
be found.

Change-Id: I9261d9350f84ab366b822addde725645a46be830
sw: remove SwFormTokensHelper implementation details from header

Change-Id: I9102caec1fec680e55e0ca66a0e1b02f41df5828