Gay men prosecuted in Germany under a longstanding anti-homosexuality law are expected to have their convictions thrown out and to receive compensation.