Device-to-Device Relaying: Optimization, Performance Perspectives, and Open Challenges Towards 6G Networks