thread: avoid dereference-after-free

Rationale: Calling a virtual method here dereferences the freed "this"
pointer, which is undefined behaviour. Fixes cid #75906
string: fix inverted logic in paste()

Added a test to validate.
Fixes cid #75944
shell: fix fd leak when fd is 0

Fixes cid #75919
mapped: initialize size properly

Fixes cid #75892
process: fix fd leak when fd is 0

Fixes cid #75891
car: don't leak file pointer

Fixes cid #75846
object: fix uninitialized member

Fixes cid #76369
string: an array can't be NULL

Fixes cid #75918
Merge pull request #43 from tmatth/more_static_analysis_fixes

More static analysis fixes