Fix some more issues found with cppcheck

Fix some performance issues found by cppcheck.

While fixing some performance issues in cppcheck added error handling to:
qa/workunits/direct_io/test_short_dio_read.c 
qa/workunits/direct_io/test_sync_io.c