Fixed insertion-speed regression with SQLite 3.8 (i.e. Yosemite)

The new query planner in SQLite 3.8 was using the very inefficient index
revs_cur_deleted for the query that finds a doc's winning revision,
which made the query very slow. Fixed it by replacing that index with
a souped-up version of the existing revs_current.
Fixes #487