use mutexes to lock access to the underlying map
Merge pull request #15 from sendgrid/fix-race-condition-for-testclient

use mutexes to lock access to the underlying map