bugfix imkmsg: infinite loop on OpenVZ VMs

On an OpenVZ VM, open("/dev/kmsg", ...) is successful, but read() fails.  This triggers an unthrottled infinite loop since klogLogKMsg() does not propagate read errors up to runInput (presumably so that rsyslog can recover from transient read errors).

This pull request fixes the issue by calling read(0) and checking for EBADF before entering the loop.

See https://bugs.launchpad.net/ubuntu/+source/rsyslog/+bug/1366829