Actual cancel function has been implemented for Network Merge.

(cherry picked from commit d0be134fd46df8b15d9eac21f45cb49c3aa0c31b)
Cleanup code has been added for cancel function.  Empty network will be removed if merge task is canceled.

(cherry picked from commit f1018ef05171e050c5769c442126b2443d9231bc)