Fixes resource tracking bug in scheduler

While merging the latest trunk into my fork, I noticed that I was missing a fairly important line to update resources in add_task. Without this, only the root task in the dependency graph will have resources in the scheduler, as we'll never override the empty resources held in the dummy tasks. I've added a test to catch this in the future.