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.
Minor 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.
Use program.time file to determine time-limit verdict (closes #122)
and also update commented code to refer to new stdio files.
Child program stdin/out (not stderr) should go transparently
through runguard to handle interactive problems. Also runguard
should never write to stdout.
Store combined error output of runguard and submission in error.out
and database, don't try to upload metadata file (not yet supported
anyways).
Properly cleanup varargs list.
Open/close metadata file once, globally. This makes it more
efficient, but more importantly allows us to open it as an empty file.
Remove options to write time and exitcode to single files,
merging these into metadata file.