Shock-induced collapse of a vapor nanobubble near solid boundaries