workaround reopen atomicity issues for stdio vs non-stdio