Fix group sidebar counts when Geo is enabled
What does this MR do and why?
This is a follow-up to !169391 (merged)
When Geo is enabled, Gitlab::Cache#delete
inserts a record to the DB.
This leads to an exception because we wrapped the count code in a
transaction that only allows read queries.
This moves the transaction so that it only wraps around the
#uncached_count
method.
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Related to #498901
Edited by Heinrich Lee Yu