Statistical hadronization of charm in heavy-ion collisions at SPS, RHIC and LHC