Validate axes and led labels correctly

Before this CL, a number of checks for kl file validity were incorrect.
Some of the APIs were supposed to return an invalid value, but instead
were always returning a valid value, no matter what the input was.

Correct these values by switching to std::optional.

Bug: 266400536
Test: m libinput_tests && adb sync data && adb shell -t /data/nativetest64/libinput_tests/libinput_tests
Change-Id: I4ef45f3249dca4f4f033fb85e9fecbc2ad1f1395
diff --git a/include/input/Input.h b/include/input/Input.h
index 30b0d6a..7573282 100644
--- a/include/input/Input.h
+++ b/include/input/Input.h
@@ -529,7 +529,7 @@
     inline nsecs_t getEventTime() const { return mEventTime; }
 
     static const char* getLabel(int32_t keyCode);
-    static int32_t getKeyCodeFromLabel(const char* label);
+    static std::optional<int> getKeyCodeFromLabel(const char* label);
 
     void initialize(int32_t id, int32_t deviceId, uint32_t source, int32_t displayId,
                     std::array<uint8_t, 32> hmac, int32_t action, int32_t flags, int32_t keyCode,
@@ -842,7 +842,7 @@
     }
 
     static const char* getLabel(int32_t axis);
-    static int32_t getAxisFromLabel(const char* label);
+    static std::optional<int> getAxisFromLabel(const char* label);
 
     static std::string actionToString(int32_t action);