Turkish court paves way to turn Hagia Sophia into mosque