[sieve] bc_eval.c: add :count match-type support to hasflag test

We can't have :count and :regex at the same time since they are both
MATCH-TYPEs
[sieve] move verify_flaglist() to flags.c for reuse elsewhere

Once we add the variables extension, we won't be able to check for
flag validity in the parser (sieve.y).  This allows us to use
verify_flaglist() wherever else we need it.
[sieve] sieve.y: an invalid flag should not cause a parsing error

[IMAP4FLAGS] Section 2 "General Requirements for Flag Handling" says
"If a flag validity check fails, the flag MUST be ignored", which for
us means that we simply remove the invalid flag from the list.
[sieve] properly handle NULL flag lists

message.c:
- changed do_setflag() to only clear out the flag list
 - use do_addflag() to add any flags after clearing the list

script.c:
- ACTION_SETFLAG: only clear out the flag list

bc_eval.c:
- B_KEEP, B_FILEINTO, B_SETFLAG: only add non-null strings to flaglist
- B_SETFLAG: consolidate addflag code

sieve.y:
 If a flag list is empty after sanitization, add a single empty string
 to the list.  This allows the bytecode to reflect the difference
 between no :flags parameter, and a :flags "" parameter specifying that
 there should be no flags applied.
Revert "[sieve] update sieve_fileinto() and sieve_keep() to use :flags parameter"

This removes the actionflags parameter that we added earlier on in
implementing the imap4flags sieve extension.  Since we have removed
dependence on this parameter, we can remove it from the functions that
previously used it.
[sieve] complete removal of no-longer-used actionflags parameter

Removed actionflags parameter from do_fileinto(), do_keep(),
sieve_fileinto_context_t, and sieve_keep_context_t
[sieve] remove superfluous sieve_addflag() and _removeflag() functions

- strarray_add_case() is identical to sieve_addflag()
- strarray_remove_all_case() is identical to sieve_removeflag()
[sieve] bytecode: don't emit unused :index parameter for hasflag test

We initially used identical bytecode for header and hasflag tests.
This patch makes the bytecode formats differ by using a code position
for the :index argument only in the case of a header test.
[sieve] flags.c: fix memory leak in verify_flaglist()
Revert "[sieve] update sievec to use sieve_register_hasflag()"

This reverts commit 869bf3f1a19d6e4f5bdb511a9faf50c3f2fe7458.
[sieve] sieve.y: remove bytecode dependence on sieve.y

The internally #define'd COPY was unnecessarily assigned to a structure
that ended up being part of the bytecode.  Since it is a true/false
value, we simply assign a value of 1 instead of the value of COPY.
[sieve] add legacy test cases for hasflag test