uml: Fix which_tmpdir failure when /dev/shm is a symlink, and in other edge cases