To scan or not to scan: The effect of channel heterogeneity on optimal scanning policies