UN's Libya envoy resigns 1 month before nationwide polls