Remove global variables from liblokatt

If the library is to support simultaneous connections to adb the legacy
implementation to read adb streams must no longer rely on global
variables.

Introduce a dynamically allocated struct to replace what was previously
globals in adb.c.
Fix misplaced #endif in adb.h

This is a late fixup of fde46da5.
Refactor: introduce subprocess structure

Introduce abstraction for child processes. This will make it easier for
the adb wrapper to manage several concurrent adb connections.
Add test result 'SKIPPED'

Some tests require a connected device. Add a new test result 'SKIPPED'
to be returned by such tests if the requirement is not fulfilled.

Skipped tests do not count against the number of passed nor failed
tests.

Known caveat: create_adb should return proper error codes if no adb
connection could be established. These error codes should replace the
is_device_connected helper function in test-adb.c
Suppress Valgrind warning from 'adb get-state'

Apparently, 'adb get-state' contains a memory leak which will be caught
by Valgrind when invoked with '--trace-children'. Since this leak falls
outside of this project, add a suppression file to squelch this specific
warning.
Add and automatically use test framework namespace

Add unique prefix to all test case functions to prevent name clashes
with non-test symbols.
String buffer struct

Add a string buffer helper structure. The underlying array is
dynamically allocated and will automatically be reallocated to a larger
size when adding contents.

The strbuf API is heavily influenced by git's implementation of the
struct of the same name.
Support adb shell commands (single shot version)

Support fire-and-forget invocations of adb shell commands.

Just establishing the adb connection takes some ~50 ms. This time could
be saved if a persistent connection to an adb shell instance was
maintained. The downsides to this are code complexity and losing support
for multiple adb shell commands running in parallel.
Simple dictionary

Add a simple map structure { int -> void * }. Ownership of inserted
items are not transferred to the map, but when the map is destroyed an
optional callback will be executed for each value allowing for
dynamically allocated items to be freed.
Add process name to lokatt message

The process name provides a less volatile field than the current pid
when filtering logcat lines from a given process. By including it in
lokatt messages there is no need for the end user to look it up manually
when the process starts.

The process name is fetched the same way as Android's implementation of
'top' fetches it: by read /proc/[pid]/cmdline. For Java processes,
Zygote will update cmdline to the Java package name once it has forked
and specialized.
Prevent deadlock in lokatt session shutdown

If the lokatt session was terminated during an ongoing adb logcat
callback, the system would deadlock. Rearrange the locking operations in
destroy_lokatt_session to circumvent this scenario.
Prevent processing of Valgrind output from hanging

The run-tests.py wrapper opens a pipe before executing Valgrind. This
pipe is used by Valgrind to write its analysis output.

Once Valgrind has terminated, the pipe is read and any data found
reformatted. But since the pipe isn't automatically closed, calling
file.read() is a bad move that will hang indefinitely, waiting for an
end-of-file that will never come.

Teach run-tests.py to read Valgrind output only until
'<//valgrindoutput>' is encountered, then continue.