cli: fix skip_auth processing

Move the skip_auth test out of the login function and into the
appropriate command functions.

The attachment, get and search commands can work whether or not a user
is logged in. On the other hand, the attach, modify and post commands
require a login.