Add support for locking execution

This should fix an issue where concurrent execution of iptables ends up in a deadlock.
Testing manually in stage.