Top police officer sacked for having sex on duty