LinuxKPI: 802.11: add checks and improve tracing to key operations
Use the IEEE80211_KEY_FLAG_BITS for logging. Add more logging to aid
debugging key and cipher operations.
Add extra checks that key is actually defined before attempting any
key operation.
Move some variables to before they are needed to avoid extra work
in case of early return. Makes their scope more clear.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days