This was inserting an s_endpgm in the middle of the block when it has
to be a terminator. Split the block and insert a branch to a new block
with the trap if it's not in a terminator position.
Fixes verifier error on LDS in function with no trap support (and
other trap sources).
I am not sure whether BB might have a fall-through successor here, an assertion saying that won't happen might be helpful. We not only want s_endpgm be terminator, but also the end of function.