move imap_conn_priv.imapstate to imap_conn.state and remove
imap_conn_get_state()

fixes to compile cleanly with gcc -std=c99

group all the STATUS-related structs in imap.h for clarity