Ensure open() raises appropriate errors on nonexistent files or bad flags.