On fields with Serre's property (F) and the finitude of Galois and flat cohomology of algebraic groups over fields