Sundry syscall buffer bug fixes and cleanups.

Includes the following changes

* use stronger types and less casting and pointer hackery when dealing
  with syscall records
* fix bug where record padding could lead to undetected overflow
* simply and optimize flush replay by writing the entire buffer in one
  shot, instead of restoring data per syscall
Merge pull request #170 from cgjones/syscallbuf-fixups

Sundry syscall buffer bug fixes and cleanups.