Protect fileio.c primitives against invalid file handler return values.