Keep backtrace in order, and try to show the application_trace frame if ...

...it exists, related to rails/rails#17312