[utils] Improve language auto discovery

Currently the auto discovery of the language doesn't take
into account usual errors related to loading a json file.
This patch adds more failure handling that should cover
these.
2 jobs for improve_language_auto_discovery in 9 minutes and 42 seconds (queued for 1 second)
Status Job ID Name Coverage
  Build
passed #168358
docker
build_linux_36

00:09:42

73.0%
passed #168359
macosx
build_macosx_36

00:05:32

73.0%