imap: Fixed accidentally lossing the result code

Accidentally lost the result code in imap_state_capability() and
imap_state_login() with commit b06a78622609.