The Mass–Concentration Relation and the Stellar-to-halo Mass Ratio in the CFHT Stripe 82 Survey