Fixed keyboard-led detection.

get_numlock_state(), get_capslock_state() and get_scrolllock_state() worked only on Windows (Now it works on POSIX as well).