WIP: Make isc_task_pause/isc_task_unpause thread safe.

Closed Witold Krecicki requested to merge wpk/task-pausing-thread-safety into master

isc_task_pause/unpause were inherently thread-unsafe - a task could be paused only once by one thread, if the task was running while we paused it it led to races. Fix it by making sure that the task will pause if requested to, and by using a 'pause reference counter' to count task pause requests - a task will be unpaused iff all threads unpause it.

Merge request reports