fixes #2039 . Decrements pending tasks in case of RejectedExecution Exception
get back the changes on unrelated method to this pr
minor fix
imports
remove unncessary latch
fix test. Possibility of second task getting the rejection exception is removed
Merge pull request #2049 from sancar/fix/executorPendingStats/master

Fix/executor pending stats/master