Better thread safety for session building <-> use.