On the mean square of the divisor function in short intervals