Changed linkage types on symbols in posix_math.cpp to match posix_math.ll

llvm trunk was rewriting the definitions to declarations, which was causing
havoc later.

Also moved where re-marking linkage happens from optimize_modules to initial
module assembly.