imap: don't check for cmd.Data in error handling code

When cmd.Data is nil but err is not, err.Error() will cause a
null-pointer-dereference.