Fixing the NullReferenceException getting thrown from FlushAllAndEnd

Fixes https://github.com/NuGet/NuGetGallery/issues/2331

Fixing the NullReferenceException getting thrown from FlushAllAndEnd of the

listener which is essentially its TraceListener.Close method

Added code to the Close method to ignore calls made to it after the first
time

Added a test scenario to the Test logger job to call Trace.Close from
multiple threads and test the behavior