Use PWD variable instead of pwd shell built-in
In this case calling `pwd` is equivalent to reading `$PWD`, as there's
no use of `cd` inbetween subsequent calls to `pwd`, and we're not using
the `-P` switch to `pwd`.
Reading the variable is ever so slightly faster, as it doesn't fork a
sub-shell in which to execute the built-in.
Commit message: Graham Ashton