Security and gain improvement of a practical quantum key distribution using a gated single-photon source and probabilistic photon-number resolution