Bugfixes/improvements to scheduler : PR #507

Cleaned up version of PR #507 - should have all review comments incorporated.
Have synced internal svn to latest spark master : so should not have goof'ups in this one !

/cc @kayousterhout @mateiz

Edit:
This PR: 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.