Look at NI instead of PRI in ps output on Linux

The PRI field is the Linux kernel scheduling priority which is
different from the niceness of a process (which is what a system
adminitrator and policy-writer is likely to want to select upon). This
value is almost always larger than 20, so it isn't selectable if the
defined range per the documentation is -20,+20 anyway.
cosmetic change
Checking for ioctl() return code in GetMacAddress()
Keep loopback interfaces, closes #1112
Don't grab mac address on interfaces having IFF_LOOPBACK flag
Add GetInterfaceFlags() to get NIC flags
Don't reuse Json array when entering new context.

This fixes a segfault when exporting the policy to Json. Basically,
whenever we had a promise type with more than one class selector, we
would enter a new class context by appending the current list of
promises to the json array. However, we did not create a new list of
promises, but kept using the old one, so the same array would be added
several times to the json array. This led to both double free() and
the resulting tree being wrong.

Fixes issue 2151.
Merge pull request #529 from kacfengine/issue-2151

Don't reuse Json array when entering new context.
Fix signature of SetDestroy
Fix warning in Set with constant element type
Get rid of done/donep fields in Promise type
Stop looping endlessly if file cannot be read in built-in functions

Specifically, regline, getfields and countlinesmatching were affected.
(Redmine #2453)
Rewrote bundle statement logic (reduce shift/reduce error by 1). we have no better error reporting for wrong bundle statement and added
constraint token test.
Do not mess with yytext for promiser_type else we can not use it for error reporting.
Do not write allclasses.txt for every bundle iteration
Get rid of skewed 'efficiency' calculation.

In case similar metric is needed later, we can calculate it by
querying state of EvalContext and traversiong Policy, not by
counting it on-the-go.
Merge pull request #532 from dottedmag/cleanups/get-rid-of-efficiency-metric

Get rid of skewed 'efficiency' calculation.
Return const pointer from PromiseTypeSyntaxLookup, for consistency
Hook promise type validation up to parser, move from semantics
Validate body type directly from parser