selftest/wscript: properly handle env.cwd which is a list, not a string