[SPARK-2552][MLLIB] stabilize logistic function in pyspark

to avoid overflow in `exp(x)` if `x` is large.
Yes, that is definitely better. Could you submit a PR? We don't need a JIRA for small changes. Btw, please cache `exp(margin)` instead of computing it twice.