Factoring channel blocking code into separate function.

- Refactored channel data copy code a little.
- Moved definition of ar_channel_t in ar_kernel.h.