Response of single bacterial cells to stress gives rise to complex history dependence at the population level