lgo: fix panic handling