Start converting circuitlist to smartlist.
Autoconvert most circuit-list iterations to smartlist iterations

Breaks compilation.

Used this coccinelle script:

@@
identifier c;
typedef circuit_t;
iterator name TOR_LIST_FOREACH;
iterator name SMARTLIST_FOREACH_BEGIN;
statement S;
@@
- circuit_t *c;
   ...
- TOR_LIST_FOREACH(c, \(&global_circuitlist\|circuit_get_global_list()\), head)
+ SMARTLIST_FOREACH_BEGIN(circuit_get_global_list(), circuit_t *, c)
  S
+ SMARTLIST_FOREACH_END(c);
Hand-fix a few global_circuit_list cases
fix remaining compilation problems
Don't allocate an extra smartlist in the OOM handler

Fixes issue 10116
Merge branch 'bug10116_squashed'