Potassium-doped BaFe2As2 superconducting thin films with a transition temperature of 40 K