Fix race conditions in namespace & keyspace refresh loops