[SPARK-1157][MLlib] Bug fix: lossHistory should be monotonically decresing

Instead of recording the loss in the costFun for each time that optimizer calls costFun, we get the loss from the api provided in breeze to avoid recording the rejection steps which will cause the loss bumping up.