Fix a potential crash in determining how wide unicode strings are.

This was caused by missing checks if the string is empty.

This is the only part in the whole Dfterm3 codebase that directly works with
pointers. A user reported a crash bug on the Bay12 forums:

http://www.bay12forums.com/smf/index.php?topic=129995.msg5209697#msg5209697

which by itself looks useless but perhaps this fixes it. Who knows.