set closeExec flags in get_device_once