(#1871) - WebSQL total_rows/get performance boosts

This is more on the order of a micro-optimization, but the changes were pretty simple and pretty obviously correct, so I don't see the harm.

If you're curious about why I'm caching `docCount`, it's because a performance analysis in the Chrome dev tools confirmed that `count(*)` was one of the costliest functions.  Apparently `count()` is never stored in SQLite, and a full table scan is always performed ([source](https://www.mail-archive.com/sqlite-users@sqlite.org/msg10279.html)).