improve codegen of uncertain ccall return types. part of #5752
Merge branch 'master' of github.com:JuliaLang/julia