checks: Refactor check output parsing

The check output/perfdata parsing is needlessly contrived (and
inefficient, though that is secondary.) This patch adds a cleaner
alternative interface to output parsing, makes better use of available
data structures and, presumably, improves performance. It also (imo)
makes the code a bit easier to follow.

Both ABI and API are preserved, through the parse_check_output
function.

Besides cleaning up the code, this patch also fixes two bugs mentioned
in GH pull request https://github.com/naemon/naemon-core/pull/26.

In other words, after merging this patch, the test cases added in PR 26
should all pass.

Signed-off-by: Anton Lofgren <alofgren@op5.com>