sql/swh-scheduler: Make the create_tasks call idempotent
This in effect returns all rows associated with the tasks asked for
creation (the input). If tasks were already created, we only return
them. If they were not created, we create and return them.