feat(util/lua): add helper functions for checking expected number of arguments in the Lua API

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
feat(library/kernel_bindings): improve argument validation in the Lua API

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
fix(kernel/level): add workaround for clang++ bug: memory leak at thread_local

The fix has an advantage. There is only one copy of level Zero in the system even when multiple threads are used.
Moreover, it does no require any form of synchronization, and modules can be initialized in any order.

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>