src/plugin.c: Use cdtime_t to calculate the sleep intervals.

Since it's easier to do calculations with cdtime_t than struct timespec,
the code becomes easier to read and maintain.