update fix ignored sort in api.py and add test
- [x] closes #43375 
- [x] tests added / passed
- [x] Ensure all linting tests pass, see [here](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit) for how to run them
- [x] whatsnew entry

As mentioned in the ticket, the function `api.union_indexes` does not handle the sort parameter. I added support for it, but we explicitly check that sort can only take the values `False` and `None` in [here](https://github.com/pandas-dev/pandas/blob/62d1f5c0fb16b6990aceabb8491d61de63cd042a/pandas/core/indexes/base.py#L2898)