Synchronize userAgentCache to make it thread-safe.

This PR contains the fix mentioned in #49.