build-sys: added githooks to do Change-Id insertion/filtering.

Added a bunch of git hooks that collectively try to automatically
insert or filter gerrit Change-Id tags depending on the branch name.
Branches matching *tizen* will have tags inserted other will have
tags filtered out. If you have a bunch of existing commits where
you want do a bulk insert/filter operation, just run git rebase -i
over the range of commits, mark all for rewording, and the hooks
will (try to) do the right thing for you.

To get the name-based insertion/filtering logic working correctly
over rebases, we have to save the branch name in a pre-rebase hook,
use the saved name if it exists or dig it out if not in the
commit-msg hook, and remove the saved name in a post-rewrite hook.
resource-dbus: fix a memory leak.
core: fix compiler warnings.

In theory, forward declarations of enums are not allowed, because C
standard doesn't define the size of enum type.
mdb: Don't use C++ keywords in variable names and structure members.
common: more debug messages for stream transport events.
common: more mainloop debug messages for I/O watches.
common: never remove forcibly a reused fd from epoll.

If during a single iteration of epoll event dispatching
a file descriptor is closed and reused, make sure the
new reused file desciptor is not accidentially removed
from epoll.

During dispatching we try to patch things up to prevent
a busy looping flood of EPOLLRDHUP/EPOLLHUP events for
users that don't properly handle them. This bug was
triggered when the closed file descriptor got reused and
a new watch for it readded from within the I/O watch
callback for the HUP event on the original closed descriptor.

This patch also makes sure that an effectively similar bug
can not be triggered by calling mrp_del_io_watch twice for
the same I/O watch.
Merge branch 'master' of github.com:otcshare/policy-internal
common: fixed a possible NULL pointer dereference in process tracking.
resource-c: added support for querying resource set id.

Also, if there wasn't a server side resource set, make the release operation
create one. This is needed so that resource set ids (assigned by server)
can be retrieved without acquiring a resource set.
resource-c: updated API test.
websockets: honour the requested/specified protocol name

Don't hardcode "murphy" as the websocket protocol name. Instead,
use the protocol name specified in the websocket address both
for bind and connect.
Merge branch 'master' of github.com:otcshare/policy-internal
common: fix a few JSON macros with extra semicolons.
core: allow also registering a class defintion by MURPHY_REGISTER_LUA_BINDINGS.
common: print empty JSON object as {} instead of null.
lua-bindings: added Lua bindings to manipulate JSON objects from Lua.
lua-bindings: JSON constructor fix for no arguments.
lua-bindings: added mrp_lua_dump_stack.
lua-utils: support for automatic handling of Lua object members.

A big bunch of code to allow easier development of Lua bindings
for native C functionality. The new features include:

  o Fully backward-compatible, actually unmodified (sans bugs) support
    for the existing class/object implementation model. If you don't
    touch your code, it's behavior (and performance) should not change.
  o Automatically handled members. Just declare member name, type,
    storage offset, read-write status, and let the infra handle the
    rest for you.
  o Change notifications. If you need to know, the infra will notify you
    whenever the value of an automaticallt handled variable has been
    changed.
  o Optional setters and getters. If a member needs a bit more complex
    handling (eg. to take care of semantic or contextual constrains),
    you can specify getters and/or setters on a per-member basis. If set
    these will be invoked to set and retrieve the value of a member when
    necessary.
  o Extended members. If you mark your class extensible, users will be
    able to extend your class from Lua by setting other members than the
    ones you have declared.
  o Fully manual members. Even if you have a class with automatically
    handled and Lua-extended members, you can declare a set of members
    'native'. These will always be handed to the setfield/getfield class
    methods where you take care of every detail of setting/retrieving
    their values.

Note that there are quite a few pending ideas that we did not have time
to implement yet. The most obvious one is the automatic handling of more
types, especially Lua classes/objects (of our object modes), arrays of
various basic types, values/calling of C-functions, and values/calling of
funcbridges. Others include things like improvements to the notifications
(to allow better/easier rejection of setting invalid values), runtime
object usage gathering (in a similar fashion to what murphy/common/mm
does for basic chunks, if tracing is enabled) and a bunch of others...

Also note that due to the amount of new code in short time, there are
very probably plenty of bugs remaining. One source of problems is hasty
raising of Lua exceptions (typically by luaL_error & co) on code pathes
where an exception will cause memory leaks. This can happen easily by
allocating objects in several go and doing calls to Lua or functions
that might raise Lua exceptions. It can happen also in a less obvious
way when a Lua exception (and the resulting longjump) will leave dangling
refrences to Lua objects. All the new getfield/setfield code paths will
need to receive eyeballing with scrutiny to identify these cases and
some of the existing functions will need to be changed so that instead
of always throwing an exception they either throw or return an error
code (and an error message) depending on whether the caller has provided
an error buffer or NULL. With such a convention, code that can get called
from both Lua and C context, can always fail gracefully without causing
leaks.