An innovative method to reduce count loss from pulse pile-up in a photon-counting pixel for high flux X-ray applications