Bug in to_json causing segfault with a CategoricalIndex (GH #10317)
Fixed GH #10317
Stole tests from #10321

oh, see you did already!
 creating the tests was the hardest part actually :)
 I agree! Glad I didn't have to.
 thanks @evanpw !
 FYI, https://github.com/pydata/pandas/commit/da3e0d1c9778ac39d1daec779d6defa322ed37b4

windows didn't like the redeclaration; gcc was ok with it...weird
