A comparison of optical and near-infrared colours of Magellanic Cloud star clusters with predictions of simple stellar population models