Measuring trends in prevalence and incidence of HIV infection in countries with generalised epidemics