In function mover, look up the global/function by name also

If there is both a declaration and a definition it can happen that the
function and the reference to it are copied seperately, hence we need
to check whether the name already exists. Otherwise LLVM will
deduplicate the name resulting in linking errors. We don't emit this
code pattern but it can happen when used with llvmcall.