Gather metadata about a testcase execution

Modify runguard to support a 'metadata' output file.
Write various key/value pairs(such as memory used, time taken, etc) to
the metadata file.
Modify testcase_run.sh to use the extra argument
Modify judgedaemon.main.php to upload the metadata file when submitting
a judging.
Properly cleanup varargs list and a few code layout fixups.
Move all child restriction code to setrestrictions() and
redirect stdio of child after calling that function to make
sure that any runguard messages do not get mixed with child
command output.
Open/close metadata file once, globally. This makes it more
efficient, but more importantly allows us to open it as an empty file.
Child program stdin/out (not stderr) should go transparently
through runguard to handle interactive problems. Also runguard
should never write to stdout.
Store combined stderr output of runguard and submission in error.out
and database, don't try to upload metadata file (not yet supported
anyways).
Remove options to write time and exitcode to single files, merging
these into metadata file and use that file to determine time-limit
verdict (closes #122).

Also update commented code to refer to new stdio files.