AMPE: fix segmentation fault

The patch "AMPE: don't process AMPE frames from
unauthenticated peers" introduced a segementation fault
after dereferencing the cand pointer after making sure it
was NULL.

Thanks to Chaoxing Lin for reporting this.