runtime/qio: use getcwd instead of getwd

getwd is deprecated in favor of getcwd.

Related to #325.
.preexec's can be any scripting language, as long as it is commented enough for us to maintain it later.