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