Bayesian inferences of galaxy formation from the K-band luminosity and H i mass functions of galaxies: constraining star formation and feedback