itimer: Don't free condvar until we know ticker is stopped
When we are shutting down the pthread ticker we signal the start_cond condition
variable to ensure that the ticker thread wakes up and exits in a reasonable
amount of time. Previously, when the ticker thread would shut down it was
responsible for freeing the start_cond condition variable. However, this would
lead to a race wherein the ticker would free start_cond, then the main thread
would try to signal it in an effort to wake the ticker (Trac #16150).
Avoid this by moving the mutex destruction to the main thread.
(cherry picked from commit 7b12b3f0240321ac1ee43f14eb9c07e015022eeb)