Task.cancel() works also for DEDICATED_THREAD_PRIORITY threads; cancel() logic fix and simplification