mediacodec: check exceptions after getCapabilitiesForType()

Avoid crashing on some devices, but it forces fallback to SW decoding.