CRAS: audio_thread - Log when input stream overruns

Fix cras_shm_check_write_overrun() function in detecting when
unread data is overwritten, and return the result so audio
thread can ATLOG this problem.

BUG=chromium:662886
TEST=Use 'cras_test_client --capture_file /tmp/1' and hit
'p','enter' a few times to emulate a bad client. Check audio
dump to veriy there's AUDIO_OVERRUN logged.

Change-Id: Ib5b90ce05d957487b29639dffbbe3067ab5f6915
Reviewed-on: https://chromium-review.googlesource.com/412428
Commit-Ready: Nicolas Boichat <drinkcat@chromium.org>
Tested-by: Hsinyu Chao <hychao@chromium.org>
Reviewed-by: Dylan Reid <dgreid@chromium.org>
5 files changed