Add support for locking execution, and prevent multiple instances from competing

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