runtime/qio: use getcwd instead of getwd

getwd is deprecated in favor of getcwd.

Related to #325.
It looks like getcwd has the possibility of returning an error if the path is longer than bufsize, so we should take that into account.