More security fixes for capabilities

This patch fixes a security issue which would allow an attackant to set bytes
to 1 at choosen places.
It also fixes a warning when DEBUG_CAPABILITIES is set.
Handle EINTR nicely

When we caught an EINTR during a select we should retry instead of returning an error
Merge pull request #22 from hardening/fix_eintr

Fix eintr