As suggested by @matu3ba, it can be better to use Security Attributesdirectly while creating the handle instead of creating the handle thensetting the handle to inherit. Doing so can prevent potentially leakingto other parallel spawned processes which would inherit the opened eviceullhandle.
This change also allows windows.OpenFile to handle when bInheritHandleis set.
Note that we are using the same saAttr, but since it's taken as apointer to a const in all calls, it's never mutated, and OpenFile never alters it.
This also saves 1 kernel call for setting the handle to inherit.