libc/misc: Migrate to upstream musl

Migrate all identical files under libc/misc to upstream musl.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
libc/passwd: Migrate to upstream musl

Migrate all identical files under libc/passwd to upstream musl.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
libc/thread: Migrate to upstream musl

Migrate all identical files under libc/thread to upstream musl.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
libc: Move _chk variants into separate files

Move the _chk variants into separate files so to simplify migration to
upstream musl.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>