connection: check policy for reply-awaiting messages as well

The current logic in bogus. We need to call kdbus_conn_check_access()
for messages that require a message as well. Also, teach
kdbus_conn_check_access() a mode in which not to look up expected
replies of a connection.
policy: indent
test: update policy tests to handle user namespaces

Upstream kernels allow unprivileged users to create user namespaces
and change their uid/gid.

These patches update kdbus policy logic to handle this case and
improve our current checks across user namespaces.

So this patch adds:

* kdbus_test_waitpid() to get exit code of childs.
* kdbus_clone_userns_test() that performs the test inside a new
  user namespace.
* Converts all the other tests to return CHECK_OK, CHECK_SKIP or
  CHECK_ERR so we are consistent.

Currently we fail at kdbus_clone_userns_test() test #8. The next patch
will fix this issue.

Signed-off-by: Djalal Harouni <tixxdz@opendz.org>
connection: rename 'entry' variable in kdbus_conn_kmsg_send()
connection: factor out queue management code to queue.c

Move code that deals with the message queue and its items into queue.c.
This way, we can work towards a cleaner structure and cut down connection.c
which has grown too big.

The sepearation is not really strict at this point, and might see some
more cleanups in the future.
policy: make policy checks work across user namespaces

Use the global kuid_t and kgid_t to store uid/gid values, this way we
our policy checks will work across user namespaces.

Note that currently we ignore that the user is privileged in its own
namespaces and the policy access kuid_t and kgid_t were mapped into that
namespace. If this is requested we can add it later a la:
fs/inode.c:inode_owner_or_capable()

Add kdbus_policy_make_access() to convert the user provided info to the
current user namespace. Userspace struct is not changed, only the kernel
one.

This patch fixes test #8 of test-kdbus-policy

Signed-off-by: Djalal Harouni <tixxdz@opendz.org>
[daniel: group kdbus_policy_db_entry_access->{uid,gid} in a union]
kdbus.txt: kill reference to sd-memfd.h
notify: explictly set payload_type = KDBUS_PAYLOAD_KERNEL
match: don't fail on invalid item types
kdbus.txt: add more documentation
connection: return -EOPNOTSUPP if the connection has already died
connection: check return value of kdbus_meta_append()
endpoint: cosmetics
connection: reformat
connection: allow wildcard matches for policy holders
match: make kdbus_match_db_remove() void
kdbus.txt: document wildcard policy entries
kdbus.txt: move error code documentation from kdbus.h to kdbus.txt

Move error code documentation from kdbus.h to kdbus.txt, and spilt the
listing by ioctls they can be returned from. That should make the list a
little more comprehensive.
tree-wide: extend copyright information to 2014
queue: fix sparse warnings