Anomalous Hall effect in thin films of the topological semimetal Co$_2$MnGa