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.
Doing two lookups into the updates map per entry in the base DB (iterateUpdates() and updates.Get() below) seems expensive. It might be better to structure this iteration in terms of iterator objects instead of a for-each callback, so you could walk the iterators in parallel without having to go back through the updates tree every time.