ubusd_monitor: fix possible null pointer dereference