Fix segfault with empty PerlClass registry