factor out the random fcntl SETFL flag generator
use random fcntl flags if we open testfile fds with fopen
scope reduction