LlvmMangler: Be more selective when mangling object types

Summary:
We previously did a wholesale replace of `%function` to `%object` to
mangle object `.type` annotations. This is bad as it can end up
replacing appearances of `"%function"` in the user's code. We now look
for a proper `.type` keyword before performing the replacement.

Thanks to @rwbarton for pointing out the bug.

Test Plan:
Previously,

    $ echo 'main = putStrLn "@function"' > test.hs
    $ ghc -fllvm test.hs
    $ ./test
    @object

Now,
    $ echo 'main = putStrLn "@function"' > test.hs
    $ ghc -fllvm test.hs
    $ ./test
    @function

Reviewers: rwbarton, austin

Reviewed By: rwbarton, austin

Subscribers: phaskell, simonmar, relrod, ezyang, carter

Differential Revision: https://phabricator.haskell.org/D150

GHC Trac Issues: #9439