inert: track the mode

Track the mode of the file descriptor so that only the requested events
are cleared when the driver stops.