Made unpickling test CWD-independent

Refs #24007.
Maybe you can you use `env = {'PYTHONPATH': '...'}` as an argument to `check_output()`?