Legalisation of sex work associated with lower prevalence of HIV in sex workers