When copying structures via imsg, the contents should not contain
bogus pointer values - make sure to zero the first rule_kv element.

awesome benno@
shorten a bit
regen
include <limits.h> for LONG_MIN/LONG_MAX.

Also remove <sys/filio.h> added from previous commit.
This was the wrong way to get FIONBIO.

ok jsing@
Add some extra sanity checks to make sure the test functions actually
run on altstack.
Fix another free error.

ok benno@