bin/data-dir: use lstat instead of stat to fix symlink handling