avoid excessive readdir. use last symlink

requires pull request on os-autoinst to be accepted first