risu: Add simple trace and replay support [WIP]

This adds a very dumb and easily breakable trace and replay support to
the aarch64 build of risu. In --master mode the various risu ops trigger
a write of register/memory state into a binary file which can be played
back to an apprentice. Currently there is no validation of the image
source so feeding the wrong image will fail straight away.

The trace files will get very big for any appreciable sized test file
and this will be addressed in later patches.

There is an inevitable amount of copy&paste between the trace file and
socket based code. Ideally it would be nice to have as much of this as
common as possible and reduce the re-implementation between the various
backends.

---

v2
  - moved read/write functions into main risu.c
  - cleaned up formatting
  - report more in apprentice --trace mode
configure: add detection of zlib to config

I've wrapped this in a generic check_lib config step in the event we
might want to use this to detect additional libraries.
risu: prepare for zlib