g_free() is already tolerant to NULL pointers. If any sigrok internal free
function is passed a partially initialized structure (i.e. some fields are
null), it will safely free it. However, if the struct pointer itself is NULL, it
will dereference it, creating a segmentation fault.

Check for NULL pointers in all *_free() functions in device.c. This makes them
tolerant to NULL pointers, and more closely mimics the behavior of g_free().

Unavoidably, this patch also contains a memory leak fix for sr_dev_inst_free().
The sr_probe structures in sdi->probes were freed, but the GSList structure
itself was not freed ("definitely lost" memory leak).