Fix a corner case in the FunctionMover
This is both a performance and a correctness optimization.
The primary change is to look into all the modules currently pending
to see if we are already in the purpose of emitting this function, but
have not yet actually run codegen on it. This is a correctness concern
for Cxx.jl and gives a small performance benefit (~5%) during bootstrap
by reducing the amount of work we're doing. However, adding this
optimization exposes a general bug in the FunctionMover, where function
attributes, which since the codegen rewrite we take into account when
computing the calling convention do not get copied to the moved function.