Check for null bytes before calling with_c_str on link_section and export_name value strings.
Cleanup the check_null function.
auto merge of #17472 : kaseyc/rust/ICE_fix, r=aturon

Add checks for null bytes in the value strings for the export_name and link_section attributes, reporting an error if any are found, before calling with_c_str on them.

Fixes #16478