Minor fixes for hstore_to_json_loose().

Fix unportable use of isdigit(), get rid of useless calculations.