Throughout history, medics and campaigners have tried to stamp out masturbation – but is modern science transforming its reputation?