Fix switch kernel bug and multi-thread issue

Need to purge image and headers as well; add some sleep time for chef
attribute propagation

Change-Id: I619acea2fd745a1dd1dbd30fcdd1928cd37676d5