BUG: fix inspect usage when pyarrow or jinja2 is not installed
This started with trying to fix the xfail when using the string dtype without pyarrow installed, but in practice this was not related to the string dtype, but just to pyarrow not being available (and apparently we only test that case in the build with the future string dtype enabled?).

We need to ensure to return an AttributeError instead of ImportError when accessing attributes on Series/DataFrame, and then `inspect.getmembers` will ignore that error.


- [ ] closes #xxxx (Replace xxxx with the GitHub issue number)
- [x] [Tests added and passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#writing-tests) if fixing a bug or adding a new feature
- [ ] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).
- [ ] Added [type annotations](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#type-hints) to new arguments/methods/functions.
- [x] Added an entry in the latest `doc/source/whatsnew/vX.X.X.rst` file if fixing a bug or adding a new feature.

Thanks @jorisvandenbossche 