Greek president appoints judge as caretaker PM ahead of new elections