Aborting from the UI didn’t work somehow. After restarting the service the tasks reappeared. I have now killed them via foreman rake-console.
ForemanTasks::Task.where(:state => :running).where(:result => :pending).destroy_all
They have not reappeared yet. I will keep an eye if the problem pops up again, if not your fix is good.