Improved type safety in TaskCompletionSourceExtensions

This also allows the class to be made public.