Prevent EINVAL in setsockopt

Several values are required to be ints rather than longs
but are not included in the if statement.
Merge pull request #199 from jleahy/master

Broken setsockopts
Fix Issue #203 - An overriding instance method doesn't have to throw
exceptions specified by it's superclass.