Charged-particle induced radiation damage of a HPGe gamma-ray detector during spaceflight