Hundreds of police officers from across the UK have been convicted of offences in the last three years including sex crimes, assaults and possessing indecent images of children, new figures have shown.