cgi-handler: Pass dir instead of fifos directly

Also for the test tool.