predeclare variable in Cursor.xs
use Perl memory alloc functions instead of malloc