Update to use Devel::CheckLib properly.

Use newx not malloc for allocation.