Move logic to wait on go routine exits before state changes. Issue #40.
Make sure to only call disconnect CB when new buffer is in place
Merge pull request #41 from apcera/waitforexits

Waitforexits