Removes the lifetime constraint on endpoints

 - Makes socket and endpoint "NoCopy"
 - Removes the lifetime constraint on endpoints
 - Replaces calls to the deprecated function task::spawn by Thread::spawn.