gh-7044: set TMPDIR to workingdir in tests

Fix https://github.com/ipython/ipython/issues/7044 and fix the broken test `test_not_writable_ipdir`.
If this needs to be changed, let's update this skip message too.