BUG: .count() raises if use_inf_as_na is enabled
- [x] closes #29478
- [x] tests added / passed
- [x] passes `black pandas`
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [x] whatsnew entry
