tcp: block instead of poll for is_polling token

Use pthread condition variable to wake waiters