[threadpool] Fix scheduler thread a coredump bug

Scheduler thread will schedule some tasks.
If a SchedulerTask's theadpool token is shutdown,
Scheduling the task would coredump.

The patch check the token whether is nullptr,
and check the Submit(...) whether is shutdowning.
And add an unit test.

Change-Id: Ie5bc5511a745f3dc12dfe1a6a1813ece41ccc2a8
Reviewed-on: http://gerrit.cloudera.org:8080/18674
Reviewed-by: Yingchun Lai <acelyc1112009@gmail.com>
Tested-by: Kudu Jenkins
Reviewed-by: Alexey Serbin <alexey@apache.org>
3 files changed