FormulaInstaller: ensure locks are always released