io/stream: added is_open() check to the file stream