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