Add error handling to FileIO::doBuffer()

Updated FileIO::doBuffer() to check for TRANSFER_TIMEOUT and set buffered to 0.