Stabilization of the Peregrine soliton and Kuznetsov–Ma breathers by means of nonlinearity and dispersion management