Refactor: python: Fix bare except problems.
- The networking code appears to only raise one exception, so we can just catch that.
- The other two spots we want to catch anything that happens when running a test or scenario so we can clean up, so in these cases we just need to tell flake to ignore them. We are already doing this for pylint.