Add extra safety check to the EGL context setup.
Add extra safety check to the EGL context setup.

Adds a check to make sure eglChooseConfig actually
found a valid config. Besides checking for EGL errors,
we also have to handle the case when no matching configs
are found, i.e when num_config is 0.

BUG=skia:

Review URL: https://codereview.chromium.org/762113003

tmpvar/skia.cc,AOSP-YU/platform_external_skia,amyvmiwei/skia,VRToxin-AOSP/android_external_skia,noselhq/skia,jtg-gg/skia,scroggo/skia,YUPlayGodDev/platform_external_skia,google/skia,DiamondLovesYou/skia-sys,scroggo/skia,YUPlayGodDev/platform_external_skia,UBERMALLOW/external_skia,AOSP-YU/platform_external_skia,rubenvb/skia,PAC-ROM/android_external_skia,chenlian2015/skia_from_google,HalCanary/skia-hc,w3nd1go/android_external_skia,OneRom/external_skia,timduru/platform-external-skia,nvoron23/skia,BrokenROM/external_skia,shahrzadmn/skia,Hikari-no-Tenshi/android_external_skia,pcwalton/skia,MarshedOut/android_external_skia,UBERMALLOW/external_skia,timduru/platform-external-skia,scroggo/skia,VRToxin-AOSP/android_external_skia,chenlian2015/skia_from_google,pcwalton/skia,OneRom/external_skia,nvoron23/skia,boulzordev/android_external_skia,samuelig/skia,noselhq/skia,samuelig/skia,timduru/platform-external-skia,HalCanary/skia-hc,tmpvar/skia.cc,timduru/platform-external-skia,aosp-mirror/platform_external_skia,MarshedOut/android_external_skia,UBERMALLOW/external_skia,OneRom/external_skia,Jichao/skia,TeamTwisted/external_skia,pcwalton/skia,Jichao/skia,google/skia,geekboxzone/mmallow_external_skia,Jichao/skia,AOSPB/external_skia,todotodoo/skia,Jichao/skia,chenlian2015/skia_from_google,DiamondLovesYou/skia-sys,scroggo/skia,YUPlayGodDev/platform_external_skia,geekboxzone/mmallow_external_skia,chenlian2015/skia_from_google,w3nd1go/android_external_skia,w3nd1go/android_external_skia,MinimalOS-AOSP/platform_external_skia,google/skia,AOSP-YU/platform_external_skia,nfxosp/platform_external_skia,Igalia/skia,shahrzadmn/skia,PAC-ROM/android_external_skia,boulzordev/android_external_skia,spezi77/android_external_skia,vanish87/skia,nfxosp/platform_external_skia,ominux/skia,rubenvb/skia,TeamExodus/external_skia,nfxosp/platform_external_skia,rubenvb/skia,geekboxzone/mmallow_external_skia,AOSPB/external_skia,w3nd1go/android_external_skia,DiamondLovesYou/skia-sys,shahrzadmn/skia,samuelig/skia,jtg-gg/skia,jtg-gg/skia,VRToxin-AOSP/android_external_skia,OneRom/external_skia,scroggo/skia,geekboxzone/mmallow_external_skia,TeamExodus/external_skia,MarshedOut/android_external_skia,ominux/skia,amyvmiwei/skia,YUPlayGodDev/platform_external_skia,HalCanary/skia-hc,noselhq/skia,todotodoo/skia,MarshedOut/android_external_skia,nvoron23/skia,todotodoo/skia,geekboxzone/mmallow_external_skia,ominux/skia,geekboxzone/mmallow_external_skia,qrealka/skia-hc,MonkeyZZZZ/platform_external_skia,ominux/skia,invisiblek/android_external_skia,MinimalOS-AOSP/platform_external_skia,geekboxzone/mmallow_external_skia,geekboxzone/mmallow_external_skia,Infinitive-OS/platform_external_skia,TeamTwisted/external_skia,VRToxin-AOSP/android_external_skia,google/skia,spezi77/android_external_skia,qrealka/skia-hc,nvoron23/skia,MonkeyZZZZ/platform_external_skia,MinimalOS-AOSP/platform_external_skia,noselhq/skia,Igalia/skia,invisiblek/android_external_skia,amyvmiwei/skia,tmpvar/skia.cc,MarshedOut/android_external_skia,timduru/platform-external-skia,TeamExodus/external_skia,Infinitive-OS/platform_external_skia,Hikari-no-Tenshi/android_external_skia,tmpvar/skia.cc,aosp-mirror/platform_external_skia,Hikari-no-Tenshi/android_external_skia,jtg-gg/skia,OneRom/external_skia,samuelig/skia,Infinitive-OS/platform_external_skia,boulzordev/android_external_skia,TeamTwisted/external_skia,MinimalOS-AOSP/platform_external_skia,TeamTwisted/external_skia,ominux/skia,MonkeyZZZZ/platform_external_skia,spezi77/android_external_skia,Igalia/skia,Infinitive-OS/platform_external_skia,TeamTwisted/external_skia,Igalia/skia,shahrzadmn/skia,VRToxin-AOSP/android_external_skia,BrokenROM/external_skia,noselhq/skia,w3nd1go/android_external_skia,MarshedOut/android_external_skia,UBERMALLOW/external_skia,chenlian2015/skia_from_google,YUPlayGodDev/platform_external_skia,qrealka/skia-hc,Igalia/skia,DiamondLovesYou/skia-sys,aosp-mirror/platform_external_skia,shahrzadmn/skia,nvoron23/skia,samuelig/skia,Hikari-no-Tenshi/android_external_skia,MinimalOS-AOSP/platform_external_skia,boulzordev/android_external_skia,ominux/skia,aosp-mirror/platform_external_skia,todotodoo/skia,HalCanary/skia-hc,todotodoo/skia,vanish87/skia,MonkeyZZZZ/platform_external_skia,pcwalton/skia,w3nd1go/android_external_skia,scroggo/skia,boulzordev/android_external_skia,rubenvb/skia,aosp-mirror/platform_external_skia,invisiblek/android_external_skia,HalCanary/skia-hc,YUPlayGodDev/platform_external_skia,Infinitive-OS/platform_external_skia,AOSPB/external_skia,TeamTwisted/external_skia,AOSPB/external_skia,Infinitive-OS/platform_external_skia,rubenvb/skia,PAC-ROM/android_external_skia,nfxosp/platform_external_skia,todotodoo/skia,boulzordev/android_external_skia,AOSPB/external_skia,google/skia,YUPlayGodDev/platform_external_skia,BrokenROM/external_skia,MarshedOut/android_external_skia,BrokenROM/external_skia,todotodoo/skia,w3nd1go/android_external_skia,TeamTwisted/external_skia,MinimalOS-AOSP/platform_external_skia,jtg-gg/skia,invisiblek/android_external_skia,rubenvb/skia,timduru/platform-external-skia,amyvmiwei/skia,rubenvb/skia,spezi77/android_external_skia,PAC-ROM/android_external_skia,aosp-mirror/platform_external_skia,TeamExodus/external_skia,vanish87/skia,shahrzadmn/skia,nfxosp/platform_external_skia,tmpvar/skia.cc,tmpvar/skia.cc,AOSPB/external_skia,geekboxzone/mmallow_external_skia,noselhq/skia,boulzordev/android_external_skia,nfxosp/platform_external_skia,vanish87/skia,HalCanary/skia-hc,nfxosp/platform_external_skia,Jichao/skia,amyvmiwei/skia,pcwalton/skia,samuelig/skia,HalCanary/skia-hc,OneRom/external_skia,nvoron23/skia,VRToxin-AOSP/android_external_skia,tmpvar/skia.cc,chenlian2015/skia_from_google,nvoron23/skia,DiamondLovesYou/skia-sys,boulzordev/android_external_skia,MarshedOut/android_external_skia,google/skia,chenlian2015/skia_from_google,UBERMALLOW/external_skia,TeamExodus/external_skia,jtg-gg/skia,VRToxin-AOSP/android_external_skia,OneRom/external_skia,PAC-ROM/android_external_skia,VRToxin-AOSP/android_external_skia,amyvmiwei/skia,aosp-mirror/platform_external_skia,shahrzadmn/skia,spezi77/android_external_skia,DiamondLovesYou/skia-sys,AOSPB/external_skia,BrokenROM/external_skia,shahrzadmn/skia,Infinitive-OS/platform_external_skia,nfxosp/platform_external_skia,TeamExodus/external_skia,AOSP-YU/platform_external_skia,amyvmiwei/skia,Hikari-no-Tenshi/android_external_skia,BrokenROM/external_skia,pcwalton/skia,Jichao/skia,timduru/platform-external-skia,todotodoo/skia,vanish87/skia,OneRom/external_skia,AOSPB/external_skia,AOSPB/external_skia,HalCanary/skia-hc,Jichao/skia,TeamTwisted/external_skia,AOSP-YU/platform_external_skia,vanish87/skia,vanish87/skia,qrealka/skia-hc,google/skia,w3nd1go/android_external_skia,boulzordev/android_external_skia,vanish87/skia,PAC-ROM/android_external_skia,MonkeyZZZZ/platform_external_skia,AOSP-YU/platform_external_skia,DiamondLovesYou/skia-sys,invisiblek/android_external_skia,qrealka/skia-hc,BrokenROM/external_skia,noselhq/skia,MinimalOS-AOSP/platform_external_skia,qrealka/skia-hc,rubenvb/skia,qrealka/skia-hc,vanish87/skia,Infinitive-OS/platform_external_skia,google/skia,tmpvar/skia.cc,UBERMALLOW/external_skia,HalCanary/skia-hc,Igalia/skia,aosp-mirror/platform_external_skia,Igalia/skia,aosp-mirror/platform_external_skia,TeamExodus/external_skia,BrokenROM/external_skia,AOSP-YU/platform_external_skia,YUPlayGodDev/platform_external_skia,TeamTwisted/external_skia,w3nd1go/android_external_skia,UBERMALLOW/external_skia,Jichao/skia,ominux/skia,Jichao/skia,spezi77/android_external_skia,nvoron23/skia,OneRom/external_skia,invisiblek/android_external_skia,rubenvb/skia,UBERMALLOW/external_skia,scroggo/skia,pcwalton/skia,pcwalton/skia,samuelig/skia,todotodoo/skia,AOSP-YU/platform_external_skia,noselhq/skia,UBERMALLOW/external_skia,PAC-ROM/android_external_skia,invisiblek/android_external_skia,PAC-ROM/android_external_skia,Infinitive-OS/platform_external_skia,HalCanary/skia-hc,Igalia/skia,MonkeyZZZZ/platform_external_skia,amyvmiwei/skia,google/skia,qrealka/skia-hc,MarshedOut/android_external_skia,Hikari-no-Tenshi/android_external_skia,AOSP-YU/platform_external_skia,nvoron23/skia,TeamExodus/external_skia,shahrzadmn/skia,MonkeyZZZZ/platform_external_skia,YUPlayGodDev/platform_external_skia,VRToxin-AOSP/android_external_skia,nfxosp/platform_external_skia,MinimalOS-AOSP/platform_external_skia,invisiblek/android_external_skia,MonkeyZZZZ/platform_external_skia,google/skia,pcwalton/skia,MonkeyZZZZ/platform_external_skia,Hikari-no-Tenshi/android_external_skia,noselhq/skia,PAC-ROM/android_external_skia,tmpvar/skia.cc,MinimalOS-AOSP/platform_external_skia,aosp-mirror/platform_external_skia,Hikari-no-Tenshi/android_external_skia,ominux/skia,rubenvb/skia,TeamExodus/external_skia,ominux/skia,samuelig/skia,scroggo/skia,jtg-gg/skia