Set close-on-exec on lock file descriptors
Set close-on-exec on lock file descriptors

The formula locks used by the installer and commands like link and
unlink are backed by open files and flock(). The open file descriptors
are thus leaked to any subprocesses. This can result in weird behavior
in programs spawned from formula that do not expect to inherit these
descriptors.

Fix this by setting close-on-exec on the lock file descriptors.

Fixes Homebrew/homebrew#21486.

amar-laksh/brew_sudo,Linuxbrew/brew,MikeMcQuaid/brew,EricFromCanada/brew,rwhogg/brew,sjackman/homebrew,tonyg/homebrew,gregory-nisbet/brew,staticfloat/brew,toonetown/homebrew,mgrimes/brew,konqui/brew,maxim-belkin/brew,aw1621107/brew,gordonmcshane/homebrew,sjackman/homebrew,DomT4/brew,aw1621107/brew,mgrimes/brew,pseudocody/brew,tonyg/homebrew,konqui/brew,pseudocody/brew,palxex/brew,amar-laksh/brew_sudo,AnastasiaSulyagina/brew,sjackman/homebrew,AnastasiaSulyagina/brew,ilovezfs/brew,mistydemeo/homebrew,claui/brew,mistydemeo/homebrew,tonyg/homebrew,bfontaine/brew,sjackman/homebrew,reelsense/brew,DomT4/brew,reitermarkus/brew,claui/brew,alyssais/brew,JCount/brew,muellermartin/dist,EricFromCanada/brew,rwhogg/brew,JCount/brew,MikeMcQuaid/brew,alyssais/brew,toonetown/homebrew,vitorgalvao/brew,pseudocody/brew,gordonmcshane/homebrew,Homebrew/brew,JCount/brew,EricFromCanada/brew,toonetown/homebrew,hanxue/linuxbrew,hanxue/linuxbrew,nandub/brew,reelsense/brew,JCount/brew,vitorgalvao/brew,mahori/brew,reelsense/brew,muellermartin/dist,mahori/brew,jmsundar/brew,vitorgalvao/brew,mistydemeo/homebrew,reitermarkus/brew,DomT4/brew,mahori/brew,konqui/brew,vitorgalvao/brew,mgrimes/brew,MikeMcQuaid/brew,reitermarkus/brew,nandub/brew,ilovezfs/brew,hanxue/linuxbrew,gordonmcshane/homebrew,alyssais/brew,staticfloat/brew,zmwangx/brew,ilovezfs/brew,maxim-belkin/brew,aw1621107/brew,nandub/brew,palxex/brew,EricFromCanada/brew,DomT4/brew,zmwangx/brew,konqui/brew,Homebrew/brew,maxim-belkin/brew,jmsundar/brew,bfontaine/brew,Linuxbrew/brew,Linuxbrew/brew,Linuxbrew/brew,MikeMcQuaid/brew,nandub/brew,bfontaine/brew,gregory-nisbet/brew,palxex/brew,claui/brew,muellermartin/dist,zmwangx/brew,rwhogg/brew,mahori/brew,staticfloat/brew,reitermarkus/brew,Homebrew/brew,claui/brew,jmsundar/brew,Homebrew/brew,AnastasiaSulyagina/brew,gregory-nisbet/brew,amar-laksh/brew_sudo