Philippine President Rodrigo Duterte has said he personally killed suspected criminals when he was mayor of a southern city to set an example for police.