Using weak pointers instead of bare pointers.

This fixes the problem that tasks might be deleted while they are still running notifyReadyObservers. Since observers did not declare any ownership of the "to be notified" tasks, this was bound to happen. Weak pointers seem a good fit in this case since shared pointers would create circular references and tasks would never be deleted.