Fix tests when JSON::XS is missing

JSON::PP doesn't add a space after the comma even when space_after is set, so handle either case.