Changing selection from tool unload crashes Renoise

Have this in a tool:

renoise.tool().tool_will_unload_observable:add_notifier(function()
  renoise.song().sequencer:set_track_sequence_slot_is_selected(1, 1, false)
end)

If this tool is enabled, closing Renoise will crash the GUI.

Tested on Linux.