Robustness improvements; explicit shutdown support

- Log exceptions in goroutines.
- Use byte arrays rather than ByteBuffers; explicitly copy out from buffer rather than using potentially shared backing store.
- Writes from async thread to channels will eventually time out (default: 30s) to avoid blocking forever.
- Writes from async thread to channels terminate immediately if close is requested.