examples: Fix samples

* Replace `protocol.close_client()` by `protocol.close()` and
`protocol.wait_closed()`.
* Remove sleeps