Fix nss_dispatch() race and add an ATF test.