qga: remove readdir_r usage and fix use-after-free Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>