[SPARK-3398] [EC2] Have spark-ec2 intelligently wait for specific cluster states

Instead of waiting arbitrary amounts of time for the cluster to reach a specific state, this patch lets `spark-ec2` explicitly wait for a cluster to reach a desired state.

This is useful in a couple of situations:
* The cluster is launching and you want to wait until SSH is available before installing stuff.
* The cluster is being terminated and you want to wait until all the instances are terminated before trying to delete security groups.

This patch removes the need for the `--wait` option and removes some of the time-based retry logic that was being used.
I can make that change, but scanning through the rest of the script it doesn't look consistent with the style that's been followed. Some examples:
* [L384](https://github.com/apache/spark/blob/2584ea5b23b1c5a4df9549b94bfc9b8e0900532e/ec2/spark_ec2.py#L384)
* [L430](https://github.com/apache/spark/blob/2584ea5b23b1c5a4df9549b94bfc9b8e0900532e/ec2/spark_ec2.py#L430)
* [L460](https://github.com/apache/spark/blob/2584ea5b23b1c5a4df9549b94bfc9b8e0900532e/ec2/spark_ec2.py#L460)
* [L506](https://github.com/apache/spark/blob/2584ea5b23b1c5a4df9549b94bfc9b8e0900532e/ec2/spark_ec2.py#L506)

Is your recommendation specific to `sys.stdout.write()`?