add base plumbing for (later) dynamic table reload

among others, we change some internal interfaces. So far, we only
add the necessary locks. More work in later commits.