Polish PM resigns after two years in office