Low-Cost Deadlock-Avoidance Policies For Flexible Production Systems