keep track of pending paths and ignore duplicates to fix #336

This solves the case of multiple parallel writes to the same file with the same contents; _pending should not be cleared until the flushed Futures complete; and we check _pending from writeString() before setting up an open->write->close future chain on it.