fix memory leak in predict + predict_probability