fts: Add blocks support.
This adds an fts_open_b() variant of fts_open() which takes a block
instead of a function pointer.
This was inspired by, and is intended to be compatible with, Apple's
implementation; however, although our FTS and theirs share a common
ancestor, they have diverged significantly. That and the fact that
we still target compilers which don't support blocks means Apple's
implementation was not directly reusable.
This is the second use case for blocks in FreeBSD (the first being
qsort_b(), which we use here). This suggest we might want to add
a COMPILER_FEATURE for blocks to avoid hardcoding any further
COMPILER_TYPE checks.
MFC after: never
Relnotes: yes
Sponsored by: Klara, Inc.
Reviewed by: kevans, theraven, imp
Differential Revision: https://reviews.freebsd.org/D49877