Replace Engine.Scan with Engine.Iterate

Move to iteration-based primitive for efficiency. This is going to be
particularly useful when we start to optimize mvcc.Scan, which
currently is very, very inefficient.

Scan and ScanSnapshot are still provided as convenience functions
which take an Engine instance as a parameter. Most existing code
has been moved to use those. Other bits of code have been moved
to use the new iteration-based approach.

Fixed a bug in Batch.Scan where insufficient entries would be
returned in the event a deletion in the updates map overrode
a value in the underlying engine and the max scan parameter was
exceeded.

Also added synchronization to protect the snapshots map in the
in-memory and rocksdb engines.
It's not ideal (and it's ugly) but just doing one was incredibly ugly.

Yes, an iterator would be a better interface, but one isn't provided by the llrb implementation we're using. In practice this inefficiency will not even be a blip on the radar. But still I've added a TODO.