Fix error when returning Task of a reference type

As pointed out by @Blewzman, a `NullReferenceException` was happening when trying to get the default value of `Task<T>` when `T` is a reference type.