Use fork and sleep for erase_node mcagent

Fix problem with connections are not closed correctly

Change-Id: Ie3aa1eaf8156120f054661af553e9b7d3e05af94
Closes-Bug: #1263405