Detection of ultra-weak laser pulses by free-running single-photon detectors: Modeling dead time and dark counts effects