Fixed a memory leak and reverted changes to PhysicalLayerMonitor::WaitForShutdown