Fix call to open_lock_tempfile on a symlink