to_json segfaulting with category type
This below code segfaults every time

```
import pandas as pd
pd.DataFrame({'cat': ['a','b','a']})
df = df['cat'].astype('category')
df.to_json()
```
## INSTALLED VERSIONS

commit: None
python: 3.5.0.final.0
python-bits: 64
OS: Linux
OS-release: 4.0.9-boot2docker
machine: x86_64
processor:
byteorder: little
LC_ALL: None
LANG: C.UTF-8

pandas: 0.17.0
nose: 1.3.7
pip: 7.1.2
setuptools: 18.2
Cython: 0.23.2
numpy: 1.9.1
scipy: 0.16.0
statsmodels: 0.6.1
IPython: 4.0.0
sphinx: None
patsy: 0.4.0
dateutil: 2.4.2
pytz: 2015.2
blosc: None
bottleneck: None
tables: 3.2.2
numexpr: 2.4.3
matplotlib: 1.4.3
openpyxl: None
xlrd: 0.9.3
xlwt: None
xlsxwriter: None
lxml: 3.4.4
bs4: None
html5lib: 0.99999
httplib2: None
apiclient: None
sqlalchemy: None
pymysql: None
psycopg2: 2.6 (dt dec pq3 ext lo64)
