Fixed possible crash if async reading is not ended correctly