sh: Move out cayman-specific panic handler code to its own file.