Fix escape() for non-strings

This PR fixes, e.g.: `require('json-pointer').compile(['arr', 1])`