Factor extract_c_headers out of wrap_c_headers (no user-facing API change)

For interactive use