cleanapicache: Close DB connection explicitly

For some reason, this wasn't closed at the end of the command, causing
a log entry every 10 minutes.