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 <span class="ref-name">wps-crashes</span> in 5 minutes and 19 seconds
Status Job ID Name Coverage
  Test
passed #190372
ubuntu-16.04

00:05:19

passed #190373
ubuntu-17.10

00:02:41

passed #190374
ubuntu-18.04

00:02:10

passed #190375
ubuntu-18.04-no-backend

00:03:13