fix unbalanced lock; test for non NULL before dereference;
fix unbalanced lock; test for non NULL before dereference;

pecharmin/bind9,each/bind9-collab,each/bind9-collab,each/bind9-collab,each/bind9-collab,pecharmin/bind9,each/bind9-collab,pecharmin/bind9,each/bind9-collab,pecharmin/bind9,pecharmin/bind9,pecharmin/bind9