Fix ensure_package_manager loop

I suck at bash scripts...