preexec: optimise performance by turning the DEBUG trap on and off

This turns off and on the DEBUG trap rather than setting and clearing
preexec_interactive_mode.  This makes a huge performance difference.

Before:
  % time for i in {0..100000} ; do true ; done
  real    0m3.963s
  user    0m3.896s
  sys     0m0.044s

After:
  % time for i in {0..100000} ; do true ; done
  real    0m0.312s
  user    0m0.296s
  sys     0m0.004s
Use env vars rather than the cache dir

Make code simpler.
Change env var names to avoid global naming conflicts