fix off by one error in _ajson_write_number, also reduced number of snprintf calls