moved socket creation to synchronized method
internal send method synchronized
Merge pull request #2 from firebase/npe

moved socket creation to synchronized method