Make Agency.current thread-safe

Uses `Thread.current['current_subdomain']` to store the current subdomain record. Also adds a subdomain-aware implementation of `reset_session`.