Austria's top court has ruled that same-sex couples can get married from the start of 2019, declaring a previous law discriminatory.