Follow up to #17422
As a follow-up, this performs small touchups in a handful of places.

Implement .pxd file for tslibs.frequencies

cimport get_freq_code in period.pyx

Replace isinstance checks in period.pyx with C-equivalents form util

Remove unused imports from period.pyx

Remove code in tseries.frequencies that can now be imported from tslibs.frequencies

- [ ] closes #xxxx
- [ ] tests added / passed
- [ ] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [ ] whatsnew entry

# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/17472?src=pr&el=h1) Report
> Merging [#17472](https://codecov.io/gh/pandas-dev/pandas/pull/17472?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/7e4e8acf5b5d68b3dfadecd3ba816d4f0b9be0ce?src=pr&el=desc) will **decrease** coverage by `0.02%`.
> The diff coverage is `100%`.

[![Impacted file tree graph](https://codecov.io/gh/pandas-dev/pandas/pull/17472/graphs/tree.svg?width=650&token=eZ4WkYLtcO&height=150&src=pr)](https://codecov.io/gh/pandas-dev/pandas/pull/17472?src=pr&el=tree)

```diff
@@            Coverage Diff             @@
##           master   #17472      +/-   ##
==========================================
- Coverage   91.16%   91.13%   -0.03%     
==========================================
  Files         163      163              
  Lines       49561    49534      -27     
==========================================
- Hits        45180    45144      -36     
- Misses       4381     4390       +9
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `88.92% <100%> (-0.01%)` | :arrow_down: |
| #single | `40.22% <100%> (-0.08%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/17472?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/tseries/frequencies.py](https://codecov.io/gh/pandas-dev/pandas/pull/17472?src=pr&el=tree#diff-cGFuZGFzL3RzZXJpZXMvZnJlcXVlbmNpZXMucHk=) | `96.11% <100%> (-0.21%)` | :arrow_down: |
| [pandas/io/gbq.py](https://codecov.io/gh/pandas-dev/pandas/pull/17472?src=pr&el=tree#diff-cGFuZGFzL2lvL2dicS5weQ==) | `25% <0%> (-58.34%)` | :arrow_down: |
| [pandas/core/frame.py](https://codecov.io/gh/pandas-dev/pandas/pull/17472?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZnJhbWUucHk=) | `97.72% <0%> (-0.1%)` | :arrow_down: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/17472?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/17472?src=pr&el=footer). Last update [7e4e8ac...b381895](https://codecov.io/gh/pandas-dev/pandas/pull/17472?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
 thanks