[libvirt] [PATCHv4 03/18] util: Refactor code for adding PID to the resource group