std: Fail more gracefully on thread spawn errors

On windows, correctly check for errors when spawning threads, and on both
windows and unix handle the error more gracefully rather than printing an opaque
assertion failure.

Closes #13589
Fix smallest-hello-world.rs interaction with `puts`

It now hands `puts` a zero-terminated string, like it expects.

Fix #13603.
auto merge of #13606 : alexcrichton/rust/better-thread-errors, r=brson

On windows, correctly check for errors when spawning threads, and on both
windows and unix handle the error more gracefully rather than printing an opaque
assertion failure.

Closes #13589
auto merge of #13608 : tbu-/rust/pr_smallesthello, r=alexcrichton

It now hands `puts` a zero-terminated string, like it expects.

Fix #13603.
std: Add an experimental connect_timeout function

This adds a `TcpStream::connect_timeout` function in order to assist opening
connections with a timeout (cc #13523). There isn't really much design space for
this specific operation (unlike timing out normal blocking reads/writes), so I
am fairly confident that this is the correct interface for this function.

The function is marked #[experimental] because it takes a u64 timeout argument,
and the u64 type is likely to change in the future.
auto merge of #13604 : alexcrichton/rust/connect-timeout, r=brson

This adds a `TcpStream::connect_timeout` function in order to assist opening
connections with a timeout (cc #13523). There isn't really much design space for
this specific operation (unlike timing out normal blocking reads/writes), so I
am fairly confident that this is the correct interface for this function.

The function is marked #[experimental] because it takes a u64 timeout argument,
and the u64 type is likely to change in the future.