Fix not handling failbit/badbit in ifstream (Last fix for #1355)