Fixed some segfaults in rlm_perl

This should fix the changes of #707
Merge pull request #709 from qnet-herwin/perl_fixes_707

Fixed some segfaults in rlm_perl