Fix some leaks in indented logging to stdio