MINOR: task: simplify wake_expired_tasks() to avoid unlocking in the loop

This function is sensitive, let's make it shorter by factoring out the
unlock and leave code. This reduced the function's size by a few tens
of bytes and increased the overall performance by about 1%.
1 file changed