TST: GH30999 Add match=msg to all but two pytest.raises in tests/io
This pull request partially addresses xref #30999 to remove bare `pytest.raises` by adding `match=msg`. It doesn't close that issue as I have only addressed test modules in the pandas/tests/io/ directory.

I thought this was going to be relatively small because there were only 25 such instances, but it turned out some of them were in methods that were reused several times, so this ended up larger than I expected.

There were a couple of cases where I found the structure of the tests quite confusing, with an internal function definition and two nested asserts. This structure also made it difficult to add the assertion about the error message. I restructured the tests to be, in my opinion, more straightforward.

There's one file, pandas/tests/io/test_sql.py, with two instances of `pytest.raises` in tests which were skipped on my machine and which I couldn't figure out how to run, so those are left as is.

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