Fix ValidationError.to_json exception in py3k