System task checking caused duplicate task

Previously whenever you called system.tasks all tasks
from candlepin were duplicated within the db every time.
It was not checking properly that the tasks already existed.
Also the logic was confusing.  This should clear it up a good bit
Merge pull request #2784 from jlsherrill/system_tasks

System task checking caused duplicate task