Fix incorrect warning/exception originator

Until now we would report the second to last function as the
exception originator, whereas we need to report the first after
skipping the usual suspects of throw_exception etc