The dilemma between dividends and safety and a generalization of the Lundberg-Cramér formulas