tab: Remove tab before unreffing the loading_task data

When there is a problem opening a file, if the user decides to dismiss the tab
clicking the 'x' button in the info bar, remove the tab before unreffing the
loading_task data. Failing to do so will likely result in an access to invalid
memory.
1 job for master in 6 minutes and 58 seconds (queued for 1 second)
Status Job ID Name Coverage
  Test
passed #274319
flatpak

00:06:58