The gas fractions of dark matter haloes hosting simulated L^ galaxies are governed by the feedback history of their black holes