fixed a bug that was causing http client to fail on mac os x with
semaphore error
Merge pull request #2375 from billy1380/master

fix for issue #2366