Revert "Card 179: Remove CodeMaid buttons on the solution explorer toolbar."

This reverts commit 73c6a5e10c6f415250f60e92c5552a14ee392d04.
Add a couple null checks to prevent silent exceptions on shutdown.