Adaptive posterior contraction rates for the horseshoe