fixed draining of remaining tasks to avoid memory leak after shutdownNow call