reimplement flush_kthread_work