Add NULL pointer checks to led sysfs file open & close helpers

Also emit a warning if file exists but can't be opened.
Do not include half of directory name in led prefix constant

Now prefix is actually existing directory and the concatenated
part does not hide initial part of the file. Which should make
it more likely that relevant strings are found by grepping the
source code.
Replace custom numof() macro with equivalent G_N_ELEMENTS() from glib
Do not use "self" pointer for arrays of objects

It is supposed to be used similarly as "this" in C++ or "self" in Python,
i.e. for member functions dealing with single object only and thus usage
as array pointer causes confusion.