move promote_complex_rhs after optimizer/sanitizer, separate add_final_return from sanitizer and run it after promote_complex_rhs

subj. @simn pls review

(closes #2327)