Local and thalamic origins of ongoing and sensory evoked cortical correlations