[libvirt] [PATCHv8 05/17] util: Refactor code for adding PID to the resource group