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

Use Net::HTTP from stdlib directly instead of rest-client and use
body_stream for streaming data upload. 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 loading it, which make memory usage worse
especially with large file, and can't upload file larger than 2 GiB
(it can't write request body larger than 2 GiB into openssl's buffer).

Also use block to close opened file properly after upload.