[kernel] locking primitive cleanup

-Add static intializers for all of the locking primitives of the form:
    foo_t bar = FOO_INITIAL_VALUE(bar);
-Remove the conditional mutex check and just test on DEBUGLEVEL > 0
[app][thread_tests] add a few tests for the static initializers
[include] add better version of STATIC_ASSERT

Uses the new C1X _Static_assert if available