[MERGE #1508 @obastemur] cross platform: Fix file descriptor leak on PAL_IsDebuggerPresent
[MERGE #1508 @obastemur] cross platform: Fix file descriptor leak on PAL_IsDebuggerPresent

Merge pull request #1508 from obastemur:fix_fd_leak

Also submitted a PR to coreclr to fix the same issue there. See https://github.com/dotnet/coreclr/pull/6958
This PR fixes the Regex/BoiHardFail.js on Fedora. See #1334
Now we have all the tests are passing on Fedora

mrkmarron/ChakraCore,Microsoft/ChakraCore,mrkmarron/ChakraCore,mrkmarron/ChakraCore,mrkmarron/ChakraCore,Microsoft/ChakraCore,mrkmarron/ChakraCore,Microsoft/ChakraCore,mrkmarron/ChakraCore,mrkmarron/ChakraCore,Microsoft/ChakraCore,Microsoft/ChakraCore,Microsoft/ChakraCore