Fixing app_read so that if a timeout of less than 1 ms is specified,