RKKY interaction in layered superconductors with anisotropic pairing