Catch errors when trying to (un)escape non-strings and fall back to returning an empty string

Fixes #67, thanks @fabianthoma