Fix a potential bug where AbstractUnsafe.flush0() fails to clear the inFlush0 flag

- Fixes #1609