Polish president Duda wins second term