mozilla: Add some NULL checks to wpa_supplicant code

This should fix some crashes seen recently:

https://bugzilla.redhat.com/show_bug.cgi?id=1692029
4 jobs for master in 4 minutes and 27 seconds (queued for 1 second)
Status Job ID Name Coverage
  Test
passed #190376
ubuntu-16.04

00:01:28

passed #190377
ubuntu-17.10

00:01:35

passed #190378
ubuntu-18.04

00:01:24

passed #190379
ubuntu-18.04-no-backend

00:04:27