fix type casts time_t vs ulong
Fixed the gc routine.

To avoid negative now - dtime, now should be updated as often as possible. A cache item could be deleted by another thread/process.