reduce errno calls

-on some platforms like Win32 and Linux, errno is a function, call it less
often for smaller binary code
Merge pull request #33 from bulk88/errno_submission

reduce errno calls, thanks to bulk88