[SPARK-4626] Kill a task only if the executorId is (still) registered with the scheduler

IMO the current approach is more explicit and readable, even if someone is not a scala expert. Using `getOrElse` to just have a side effect of printing a log statement is also a bit awkward.