Make sure the correct errno is reported by warn* or err* and notthe errno of an intervening cleanup operation like close/unlink/etc.Diff from Doug Hogan (doug (at) acyclic.org)
Delete unused variables found by -Wall
Add regression tests for stdio threading. Originally by blambert withsome further hacking by me