mraa.c: check lang_func allocated resources correctly
mraa.c: check lang_func allocated resources correctly

We need to distinguish from an error on mraa_init() and simply not having found
a platform

Signed-off-by: Brendan Le Foll <3e0e8c4069934e8b47d99704927a85c66c0ceb33@intel.com>

Pillar1989/mraa,arfoll/mraa,sergev/mraa,arfoll/mraa,stefan-andritoiu/mraa-gpio-chardev,whbruce/mraa,andreivasiliu2211/mraa,intel-iot-devkit/mraa,arfoll/mraa,intel-iot-devkit/mraa,sergev/mraa,jontrulson/mraa,spitfire88/mraa,KurtE/mraa,petreeftime/mraa,stefan-andritoiu/mraa-gpio-chardev,ProfFan/mraa,yongli3/mraa,Propanu/mraa,Hbrinj/mraa,whbruce/mraa,stefan-andritoiu/mraa,whbruce/mraa,malikabhi05/mraa,andreivasiliu2211/mraa,g-vidal/mraa,spitfire88/mraa,ProfFan/mraa,jontrulson/mraa,Pillar1989/mraa,ncrastanaren/mraa,arfoll/mraa,KurtE/mraa,g-vidal/mraa,g-vidal/mraa,ProfFan/mraa,alext-mkrs/mraa,ProfFan/mraa,stefan-andritoiu/mraa,sergev/mraa,spitfire88/mraa,jontrulson/mraa,Propanu/mraa,alext-mkrs/mraa,andreivasiliu2211/mraa,Hbrinj/mraa,yongli3/mraa,yongli3/mraa,ncrastanaren/mraa,Jon-ICS/mraa,intel-iot-devkit/mraa,jontrulson/mraa,intel-iot-devkit/mraa,whbruce/mraa,Jon-ICS/mraa,Hbrinj/mraa,jontrulson/mraa,KurtE/mraa,intel-iot-devkit/mraa,andreivasiliu2211/mraa,w4ilun/mraa,yongli3/mraa,alext-mkrs/mraa,stefan-andritoiu/mraa,Propanu/mraa,stefan-andritoiu/mraa,malikabhi05/mraa,Propanu/mraa,petreeftime/mraa,spitfire88/mraa,w4ilun/mraa,petreeftime/mraa,KurtE/mraa,g-vidal/mraa,ncrastanaren/mraa,Pillar1989/mraa,Hbrinj/mraa,w4ilun/mraa,arunlee77/mraa,sergev/mraa,Propanu/mraa,stefan-andritoiu/mraa-gpio-chardev,sergev/mraa,malikabhi05/mraa,alext-mkrs/mraa,g-vidal/mraa,stefan-andritoiu/mraa-gpio-chardev,KurtE/mraa,arunlee77/mraa,yongli3/mraa,stefan-andritoiu/mraa,Jon-ICS/mraa,malikabhi05/mraa,arfoll/mraa,alext-mkrs/mraa,petreeftime/mraa,arunlee77/mraa,ncrastanaren/mraa,w4ilun/mraa,arunlee77/mraa,malikabhi05/mraa,stefan-andritoiu/mraa-gpio-chardev,ncrastanaren/mraa