[PATCH RFC v2 1/4] pidns: move is-ancestor logic to helper