Bugfixes/improvements to scheduler.

a) Prevents re-execution of a task on an executor where it just failed.
The motivation for this is detailed in the comment - but in short, repeated re-executions on a worker which is failing can cause the entire job to fail : which could have worked if the re-execution had been attempted on a different node.

b) Tries to schedule all available cores on a node for the given maxLocality.
This is applicable in scenario where you have multiple threads per worker - not otherwise : which was possible in yarn mode only recently.