Translate const references to extern functions as *i8 instead of the typ...

...ical closure pair. Fixes #4522.