getRecentName(): use realpath(3) instead of errorprone 'chdir()' calls