Fix some warnings which are causing debug builds to fail.

- Clang: private field 'module' is not used
- GCC: "bool has_privs" is not initialized
- GCC: suggest a space before ‘;’ or explicit braces around empty
       body in ‘while’ statement