Maybe we could do _pending.remove(pathString) after close?

```dart
file.writeString(text)).then((file) => file.close())
    .then((_) => _pending.remove(path));
```