globally remove pointless null test before free()

Coccinelle patch used to perform this cleanup is included.

Change-Id: Ia367764245c845839fd22034b2b5f58b93bd54e8
knotc: fix memory leak when installing the key

Change-Id: I571cc82f393d526e43ba17ade19f57ce067b5c52