Fix bug in previous fix for #5654
Fix bug in previous fix for #5654

I forgot to account for BCOs, which have a different layout from
functions.  This caused crashes when using profiling with GHCi (via
-fexternal-interpreter -prof), which unfortunately is not tested at all
by validate, even when profiling is enabled.  I'm going to add some
testing that would have caught this in a separate patch.

Test Plan:
```
cd nofib/spectral/puzzle && make NoFibWithGHCi=YES
EXTRA_RUNTEST_OPTS='-fexternal-interpreter -prof'
```
New testsuite tests coming in a separate diff.

Reviewers: niteria, austin, erikd, bgamari

Reviewed By: bgamari

Subscribers: thomie

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

GHC Trac Issues: #5654

olsner/ghc,olsner/ghc,olsner/ghc,sdiehl/ghc,olsner/ghc,ezyang/ghc,shlevy/ghc,shlevy/ghc,sdiehl/ghc,shlevy/ghc,shlevy/ghc,shlevy/ghc,olsner/ghc,olsner/ghc,olsner/ghc,sdiehl/ghc,ezyang/ghc,sdiehl/ghc,sdiehl/ghc,shlevy/ghc,shlevy/ghc,sdiehl/ghc,ezyang/ghc,sdiehl/ghc,ezyang/ghc,ezyang/ghc,ezyang/ghc,ezyang/ghc