Thread safety issues.

AdFactory._ads and AdFactory._ad_slots were not threadsafe.

refs #3448