On the divisor function in short intervals