new: Fix missing end_atomic in remove_filename on error