Fix gcd browser process lifetime management
GCD contains the code that manages the browser process lifetime. Currently calling ExitProcess sends a SIGKILL message and instantly returns without waiting for the process to exit. This causes problems for our integration tests where browsers can be starting and stopping at the same time. Ultimately this results in browser instances never getting killed. This results in some test instability.
To improve upon this we should instead try sending SIGTERM asking the browser to shutdown nicely and clean up any resources and files. Only if SIGTERM doesn't work should we resort to sending a SIGKILL. Additionally we should synchronize with the goroutine that calls Wait on the process to make sure all resources are cleaned up and the browser process has exited before returning from ExitProcess