Never use selected_images in control_jobs (remove/delete).

Indeed between the time we click on delete and the time where the
SQL statements get executed there is a small window where the
user could click on some images and change the selection.

This could even been far more a problem with scripts like Lua.

Instead of using the selected_images table we now properly get the images
to work on from the list associated with the job.

Take the opportunity to refactor some code for better sharing. This fix
an obvious bug where in dt_control_delete_images_job_run we where getting
only the first images for checking for duplicates.
(cherry picked from commit 23299b7acef3ab12a36210ae8935db352ae54cf8)
Attempt to fix compilation issue.
(cherry picked from commit 2495dfe529ca060e10228b0195cb5fe4c920074e)
Another attempt to fix compilation issue.
(cherry picked from commit 97ef4e89e03b373c22230f536f4a408090c11517)
Revert "Add support for calculator formulas in conf"

This reverts commit dc4a27c35054337c2b98e00734424ff8813cc218.