Thermalization and condensation in an incoherently pumped passive optical cavity