Refactored WikiPage::updateCategoryCounts() to use upsert().

* Also made it avoid inserting aggregate rows on membership
  decrement if there was no prior row aggregate row.

Change-Id: I7e6d07e42cc06cedbd9d10ed9f276f20636dc222