[utils] Fix multipart_encode for Python < 3.5