dbcheck: only calculate linked attribute helper variables once in check_dn()