Added IOError handling to delete. Slightly refactored delete_lines_containing_files_in_file()