Translate const references to extern functions as *i8 instead of the typical closure pair. Fixes #4522.
Add test case for change in 039bfe