minimize unsafe usage
Add small sleep

Sometimes the socket send takes longer than the channel send, which
can lead to failed tests due to synchronization issue.

Unsure the best way to fix it, but a small sleep seems to stabilize
the test.