Interplay of rare earth and iron magnetism in RFeAsO (R=La, Ce, Pr, and Sm): Muon-spin relaxation study and symmetry analysis