Fix bug where querying time-in-state for a device that has never
changed state tripped over an uninitialized variable reference.