Medina wins 2017 MEO Rip Curl Pro Portugal