Fix ioctl flag determination.

Resolves #1407.
Work around a new bug in fedora-gdb's 'run' command.