New constraints on quantum foam models from X-ray and gamma-ray observations of distant quasars