handle non-BMP unicode chars in _trunc()

@gwprice @nedbat 

here's a mod to our string truncation function that should correctly count / iterate the non-BMP characters on narrow builds (e.g., my laptop, where the tests now pass).  it gets the job done and isn't overly complicated, though i'm sure it could be improved.