[SPARK-2750] support https in spark web ui

https://issues.apache.org/jira/browse/SPARK-2750

enable spark web ui to support https, also compatible with old web ui(http).

user can switch between https and http by configure "spark.http.policy".
Hi @vanzin, actually here i just refer to the code of jetty 9 see(https://github.com/eclipse/jetty.project/blob/master/jetty-util/src/main/java/org/eclipse/jetty/util/URIUtil.java#L726-L733)  since there is no ```newURI```method in spark jetty version(spark use jetty 8).

And  L238 is for the case to handle IPv6 address, here we can remove it if unnecessary.