backtrace: Refactor ast_bt_get_symbols so it doesn't crash