Add getRowCount command

Uses the db mutex to track and persist the total row count. Also adds a new `meta` key to storage.