make unlink() more robust
fix #29996