Added task_handle conversion to and from void pointer.

This allows task_handle objects to be passed through interfaces
which don't preserve types.