Fix garbled dir on extraction (closes GH-1)

Add a missing \0 on receiving the char* from the XDS_ATOM. g_strndup is
needed, because the returned char* is of fixed length and one byte too
small if it has no final \0.