flushing persistence windows no longer causes buffer under/ overflow

This ensures that when flushing, a duplicate buffer is used so that the state of the flags on the buffer do not change