Add locking to mbtiles commits -- sqlite3 doesn't allow concurrent transactions.
Clear caches once -- at the beginning of the commit -- so more writes can be queued behind it.
Merge pull request #40 from mapbox/committing-lock

Add locking to mbtiles commits