network.ManInTheMiddle: Stop execution when the parent thread finishes

This is useful because when the library is used from anywhere, not just
the UI currently provided using Qt, it won't be necessary to worry about
what needs to be done when the app finishes.

Without this change, when the app was closed by the user, the threads
created for the attack kept running forever.