Emulating realpath if it's missing