refactor IDS/IPS engine mode logic

Instead of error prone externs with macro's, use functions with a local
static enum var instead.

- EngineModeIsIPS(): in IPS mode
- EngineModeIsIDS(): in IDS mode

To set the modes:

- EngineModeSetIDS(): IDS mode (default)
- EngineModeSetIPS(): IPS mode

Bug #1177. https://redmine.openinfosecfoundation.org/issues/1177

Prscript:
- PR build: https://buildbot.suricata-ids.org/builders/inliniac/builds/263
- PR pcaps: https://buildbot.suricata-ids.org/builders/inliniac-pcap/builds/182