Germany's competition watchdog has cleared plans from retailers Edeka and Tengelmann to merge their discount chains but has ordered the sale of almost 400 stores before the deal goes through.