add documentation to calling-c-code on type mappings, unsafe_ref, garbage collection safety (closes #1990)