A test of genetic models for the evolutionary maintenance of same-sex sexual behaviour