Make sure stdout file's directory exists.