State-dependent changes in perception and coding in the mouse somatosensory cortex