Fixed root path resolution in buildgear.sh

Made resolution of working directory independent of symbolic links. The
buildfiles environment paths used to vary depending of root path having
symbolic path elements or not. This is now fixed so all paths are
resolved to absolute paths (basically ignoring symlinks).