put: get rid of rest-client, reduce memory usage by 2~3 times upload file size

Use Net::HTTP from stdlib directly instead of rest-client. Although
rest-client has the modified Net::HTTP ‘request’ method to support
streaming data upload base on whether the body has 'read' method
automatically, but never actually use it, that means it will always
read the entire file into memory before upload (note the payload.to_s
in it). Rest-client also seems to copy the upload file object several
times in memory after read it, which make memory usage worse especially
with large file, and can't upload file larger than 2 GiB (it can't
write http post request body larger than 2 GiB into ssl buffer).

Also use block to close opened file properly after upload.