Redis: Added a lock in the event loop before reading the earliestTimeout...

.... Also improved the timeout test case