Fix an intermittent failure in macOS logging tests (#8385)
Fix an intermittent failure in macOS logging tests (#8385)

Fix an intermittent failure in macOS logging tests
  - make tests wait for the correct number of log entries
  - make tests not fail with an `Index was outside the bounds of the array.` error
JamesWTruher/PowerShell-1,daxian-dbw/PowerShell,PaulHigin/PowerShell,PaulHigin/PowerShell,JamesWTruher/PowerShell-1,daxian-dbw/PowerShell,PaulHigin/PowerShell,TravisEz13/PowerShell,TravisEz13/PowerShell,JamesWTruher/PowerShell-1,daxian-dbw/PowerShell,PaulHigin/PowerShell,JamesWTruher/PowerShell-1,TravisEz13/PowerShell,daxian-dbw/PowerShell,TravisEz13/PowerShell