Exposed ClientHandler::OnBeforeClose

Exposed OnBeforeClose to handle the destroying of browsers (of
particular use when a browser is forcibly being closed via JavaScript).