Fixes Issue 9047 - Expression requiring std.math fails with local import

Search local imports for std.math before attempting to rewrite call
to a global import of std.math.