Avoid a crash when Record#inspct is called on exit

GitHub: fix #18

Reported by Ippei Obayashi. Thanks!!!