Mysql: remove CONNECT BY and use FIND_IN_SET instead, remove unused queries, use again GetFromTaskAndType

This is a patch to apply on top of https://github.com/dmwm/CRABServer/pull/4143