Successive renewal of short-term contracts not always unlawful, court rules