thpool: add schedqueue concept

a SchedQueue is (almost) a thread-safe sched (see the sched module)
implemented on top of a Queue.PriorityQueue with minor modifications.

I'd like to have a SchedQueue clearly inherit from Queue.PriorityQueue,
but looks like this is not possible without inefficient (and
possibly error prone hacks), so I had to fork it.

I took the chance to shed some legacy and modernize the code along
the way.

License of this module is (and should be) the same of the python
library code.
thpool: switch to SchedQueue

to have a real interval enforcement (= work NOT executed too *often*)