Implement timedeltas for to_json

Closes #9027
`total_seconds()` doesn't exist in python 2.6, so i need a way to do that for `timedelta`s, because `timedelta` (not to be confused with `pandas.Timedelta`) can show up in mixed type `Series`/`DataFrame`s