On the variance of squarefree integers in short intervals and arithmetic progressions