A shared inhibitory circuit for both exogenous and endogenous control of stimulus selection