A cognitive behavioural intervention to reduce sexually transmitted infections among gay men: randomised trial