kernel: fix various errors in file descriptor prassing code
kernel: fix invalid assertion in capsicum rights validation