Cli: Write ApiListener config in 'agent setup' command

fixes #7438
refs #7248