runtime/qio: use getcwd instead of getwd

Included code for handling errors.

Related to #325.
Merge pull request #332 from fsouza/getcwd

runtime/qio: use getcwd instead of getwd [on behalf of fsouza]

getwd is deprecated in favor of getcwd.  Related to #325.