wposix: use Liberror_set_errno various other improvements spotted while looking through code. This was SVN commit r3281.