BUG: Fix to_json when converting Period column
AttributeError  when trying to access frequency string ``freqstr`` directly on Series of ``Period`` type. 

Modified to get it through ``dtype`` of Series, which is known to be ``Period``.

- [X] closes #31917
- [X] fix #31917
- [x] tests added / passed
- [x] passes `black pandas`
- [ ] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [x] whatsnew entry

```python
import pandas as pd
test = pd.Series(pd.period_range('1/1/2011', freq='B', periods=3))
test.to_json(None, orient='table')

>>> '{"schema":{"fields":[{"name":"index","type":"integer"},{"name":"values","type":"datetime","freq":"B"}],"primaryKey":["index"],"pandas_version":"0.20.0"},"data":[{"index":0,"values":{"day":3,"dayofyear":3,"daysinmonth":31,"freqstr":"B","is_leap_year":false,"month":1,"ordinal":10697,"qyear":2011,"start_time":"2011-01-03T00:00:00.000Z","week":1,"weekofyear":1}},{"index":1,"values":{"day":4,"dayofyear":4,"daysinmonth":31,"freqstr":"B","is_leap_year":false,"month":1,"ordinal":10698,"qyear":2011,"start_time":"2011-01-04T00:00:00.000Z","week":1,"weekofyear":1}},{"index":2,"values":{"day":5,"dayofyear":5,"daysinmonth":31,"freqstr":"B","is_leap_year":false,"month":1,"ordinal":10699,"qyear":2011,"start_time":"2011-01-05T00:00:00.000Z","week":1,"weekofyear":1}}]}'
```