[sqlite] use checkpointing instead of vacuum
[sqlite] use checkpointing instead of vacuum

Summary:
`VACUUM` is used to shrink the size of DBs destined for caching (eg in buck), as well as to "canonicalise" their content into something deterministic.

VACUUM does two things:
1. it incorporates the WAL log into the main DB file.
2. it compacts the DB by combining half-empty pages and generally moving things around.

(2) is quite costly. In addition, it doesn't achieve byte-determinism (for instance, `VACUUM` is not idempotent wrt `md5sum`).

This diff replaces `VACUUM` with `PRAGMA wal_checkpoint` which only aims at doing (1). This saves considerable time on large DBs.

Reviewed By: skcho

Differential Revision: D32758493

fbshipit-source-id: a3688b13d5

facebook/infer,facebook/infer,facebook/infer,facebook/infer,facebook/infer,facebook/infer,facebook/infer