Install a window error handler so we can log errors