[test_utils] Fix compat_getenv and compat_expanduser tests on python 3.x