Misc stability fixes from https://github.com/joaompneves/cefsharp

Basically https://github.com/ataranto/CefSharp/pull/58 with minor cleanups.