Fix warnings when stricter options enabled

This fixes a number of warnings for signedness, enum values, and masked globals so that compiling with stricter warnings enabled does not complain.

There is one line at lelib/lecore.m:140 where I notice that the return value from write() is not being checked for (-1), although now with this patch and not casting away the sign of the return value, we should at least catch that condition.  The code there might want a bit of cleanup.