Optimized unsafe_symlink() to avoid malloc/free calls.