Clean whitespace off token.

A bogus, non-visible character may be appended to the token.
If it is, the hash will not match the original, and the token
will be incorrectly reported as invalid.

Change-Id: I7b2c831b85818a8c07616f44c1d501701c9d72f8
Closes-Bug: 1354765
Merge "Clean whitespace off token."