MirBSD and NetBSD support

These changes enable using the shadow module on two more BSD flavors, NetBSD and MirBSD. Thank you.

Tested with Ruby 2.1.1 on MirBSD/i386.