dbcheck: add a helper function that checks is a value has duplicate links