bughunt: Fix possible null pointer dereference

Thanks to https://stedten.imp.fu-berlin.de/jenkins/job/RIOT%20cppcheck/2/cppcheckResult/ I found some possible tripping hazards.