[bug 987471] close_old_connections() before updating metrics

Our DB load balancer closes connections after 5 minutes. Our cron
jobs that talk to google analytics, take a lot more than that. So
we close the connections after before updating the database with
fresh data from google analytics. This means new connections are
opened and all is good.