[SPARK-4449][Core] Specify port range in spark

In some case, we need specify port range used in spark, such as firewall.
0 is passed through to the start function unchanged.

This looks better, but I think we have to be careful with the semantics. "spark.port.max" sounds like a maximum allowable port, inclusive, but the way it's used here it's exclusive. That is, if I want to use ports 9000-9005, I would have to set min=9000 and max=9006, which isn't intuitive. You may need `endPort+1` and document this.

This doesn't work if `port` isn't in the range, right? that seems like a problem.