Go back to having a takeModule instead of a getModule.

Returning a std::unique_ptr is more constrained. Thanks to David Blaikie for the
suggestion.

git-svn-id: http://llvm.org/svn/llvm-project/cfe/trunk@215979 91177308-0d34-0410-b5e6-96231b3b80d8
Move the body out of line to try to fix a buildbot.

git-svn-id: http://llvm.org/svn/llvm-project/cfe/trunk@215980 91177308-0d34-0410-b5e6-96231b3b80d8