prim: fixed bug in sending signals

Whenever MST algorithm ran, signal SIG_MST_UPDATED got called even if
no MST was updated which caused segfault