Add no O_NOCTTY, required for when there is no controlling terminal

If this flag isn't there an the process doesn't have a controlling terminal it otherwise gets automatically assigned to the current process and fails to assign it to the child process.