Empty page cache at close using iterator.

See #365.