unix: rework TestGetwd to handle test dirs whose names contain symlinks
unix: rework TestGetwd to handle test dirs whose names contain symlinks

TestGetwd can fail on systems that have unexpected directory/partition configurations
using symlinks.

Fixes golang/go#26678

Change-Id: I44dba94c5e8b6a8e1e7e112cd7d0541d22b65d84
GitHub-Last-Rev: 727a6cc6a718969828a15d1016c89ea9be8a12e0
GitHub-Pull-Request: golang/sys#22
Reviewed-on: https://go-review.googlesource.com/c/148537
Reviewed-by: Tobias Klauser <0a68dd4915066ec5d3f81f75a828fee53dcc8822@gmail.com>
Run-TryBot: Tobias Klauser <0a68dd4915066ec5d3f81f75a828fee53dcc8822@gmail.com>
TryBot-Result: Gobot Gobot <66cb808b70d30c07676d5e946fee83fd561249e5@golang.org>

multiplay/golang-sys,multiplay/golang-sys,multiplay/golang-sys,golang/sys,multiplay/golang-sys,golang/sys,golang/sys