driver core: fix race between creating/querying glue dir and its cleanup