Reduction of particle contamination by controlled venting and pumping of vacuum loadlocks