Tests: fix expected exception type (IOError instead of OSError)