dgraph: add dgraph_check and CCAN_DGRAPH_DEBUG