Loss-induced suppression and revival of lasing