fixed limit.c so that exitcodes aren't ignored

also, save stdout and stderr of tests (in files with these names)