fix random segmentation fault during edge purging

Link: https://github.com/sebhtml/ray/issues/213
Signed-off-by: Sébastien Boisvert <sebastien.boisvert.3@ulaval.ca>