Collective dynamics of actomyosin cortex endow cells with intrinsic mechanosensing properties