Cavity QED of a leaky planar resonator coupled to an atom and an input single-photon pulse