Fix task storage so that it calls dtor for the stored value.