Adding additional check to if shutdown is already in process

-#2959
-preventing calling of multiple shutdowns.