Move the reading code of login command over to g_imap_login() function.

Signed-off-by: Thiago Farina <tfarina@chromium.org>