imap: Introduced FETCH_FINAL state for processing final fetch responses

A typical FETCH response can be broken down into four parts:

  1) "* <uid> FETCH (<what> {<size>}\r\n", using continuation syntax
  2) <size> bytes of the actual message
  3) ")\r\n", finishing the untagged response
  4) "<tag> OK ...", finishing the command

Part 1 is read in imap_fetch_resp(), part 2 is consumed in the PERFORM
phase by the transfer subsystem, parts 3 and 4 are currently ignored.
imap: Added processing of the final FETCH responses

Not processing the final FETCH responses was not optimal, not only
because the response code would be ignored but it would also leave data
unread on the socket which would prohibit connection reuse.
imap: Fixed error code returned for invalid FETCH response

If the FETCH command does not result in an untagged response the the
UID is probably invalid. As such do not return CURLE_OK.