Catch invalid filenames in append_entry() This prevents the index api from calling write_tree() with a bogus tree.