refactoring and cleanup of make_nonblocking_noninheritable()