fix bugs

FIX: FSDirectory based file cannot delete because FSDirectory is closed.