Gravar-mail: Improving pulse detection in multibin photon-counting detectors