Stability analysis for manufacturing systems with unreliable machines and random inputs