preload: Move to real signature of ioctl()

Make ioctl() a varargs function to avoid collision with the standard include
files, and pick the first argument.
Fix detection of mismatching devices when recording into an existing file

Opening the existing file with mode "a" wouldn't allow us to read anything, so
open it with "a+". The read position defaults to the start of the file, so for
ftell() to work we need to seek to the end first. Fix the ignoring of the
first non-comment character and the string comparison.
preload, script_start_record(): Rework parsing of existing script device

This avoids the error prone ungetc() and switches to line-based parsing. This
also simplifies supporting other output formats in the future.
Add recording of evemu .events files

Introduce the concept of a "script format" to the preload, and support the
default (umockdev) and evemu's event formats.

Add -e/--evemu-events=devname=eventsfilename option to umockdev-record, to
record reads from an evdev device into an evemu .events file.