[#2212] CID43797:

free authCheckOut when it leaves scope
[#2212] CID43796:

replaced close, dup with dup2
[#2212] [#2222] CID49419 and CID49406:

Removed dead code, refactor for scoping concerns