[#2209] Allow to cancel non-flushed writes
Correctly handle cancelled writes