SPARK-4214. With dynamic allocation, avoid outstanding requests for more...

... executors than pending tasks need.

WIP. Still need to add and fix tests.
This entire class is designed to not rely on internals of the scheduler - if you look it gets all of it state through the listener. Can you just ask for totalPendingTasks from the listener?