Issue #12: Use different error-numbers on BSD and other OSes

Added static system property queries to decide which error numbers should be used based on the current operating system. Tested on Linux, I don't have access to Mac OS X or BSD, so cannot fully test there...

This closes #12.