[DebugInfo] Fix infinite recursion when opaque return type is defined
inside function returning it
A stack overflow would happen when the compiler tried emitting debug
info for a function whose opaque return type was declared inside the
function itself. This fixes the issue by emitting a forward declaration
for the function before emitting it.
rdar://150313956
(cherry picked from commit c03831f70da3d67f7a024658595e47667e1f63ea)