Eventscript functions: optimise ctdb_check_tcp_ports() and add debug.