[PIMCORE-2418] Added a typesafe comparison so so tasks not get loaded again when removing last scheduled task