ts: catch & append general exceptions into log
Merge pull request #1890 from alalek:ts_fix_seh_exceptions_handling