Fix crash on OSX when Mono internally frees a System.Diagnostics.Process.

Changes ported from upstream mono fixes made in 2010:
https://github.com/mono/mono/commit/579a0ca72b996d11a50ddf6ddb4f67e59995072d
https://github.com/mono/mono/commit/3b6f5c33088c53280980218f82168e3cba00a25b

More details on this issue: http://mono.1490590.n4.nabble.com/Process-SIGSEGV-on-Mono-2-8p6-td2713681.html
Properly dispose the VM in the debugger agent thread when the socket connection is closed. Fixes issues with the debugger agent thread stopping and suspend_current () being stuck in infinite loop when the debugger socket connection is closed.
Local merge.
Fix build for Windows.

https://github.com/mono/mono/commit/2b638808bf4e24c8f46643038fed8cb95ff46045
https://github.com/mono/mono/commit/0cc9d6ecd008356906bb356147053d1cef887277
Merge pull request #159 from Unity-Technologies/unity-staging

OSX crash fix and debugger lost socket fix.