[libvirt] [PATCHv2] build: fix build on platforms without ptsname_r