CRAS: client - Factor out parts of read and write callbacks.
CRAS: client - Factor out parts of read and write callbacks.

These parts of the capture and playback callback will be re-used in
the unified IO callback when it is added.

BUG=chromium-os:35272
TEST=play/record audio with test client.

Change-Id: Icca24321a9efbdcfc31f23b4da17a65c26372085
Signed-off-by: Dylan Reid <c791bfe44996c1eed9c7149a0c5f12a86d58eb85@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/40962

drinkcat/adhd,drinkcat/adhd,drinkcat/adhd,drinkcat/adhd,drinkcat/adhd,drinkcat/adhd