A while back, a bunch of module pointers were changed to unique_ptrs but the
places where they were used weren't updated correctly. This patch fixes two
crashes I've come across. There may be more.
It's a bit sad that we have no tests for this code path in bugpoint and that
nobody seems to have noticed these until now.