patch 8.1.2066: no tests for state()

Problem:    No tests for state().
Solution:   Add tests.  Clean up some feature checks.  Make "a" flag work.
diff --git a/src/misc1.c b/src/misc1.c
index 3c0bd41..4566ca2 100644
--- a/src/misc1.c
+++ b/src/misc1.c
@@ -1297,7 +1297,7 @@
 	may_add_state_char(&ga, include, 'o');
     if (autocmd_busy)
 	may_add_state_char(&ga, include, 'x');
-    if (!ctrl_x_mode_none())
+    if (ins_compl_active())
 	may_add_state_char(&ga, include, 'a');
 
 # ifdef FEAT_JOB_CHANNEL