Revert "replace checking badbit with failbit in iostream ops"

This reverts commit 5475c66f90fcbb811e8989bdec809bb54e3593ca.