Converted libs to use ARC, fixed memory leaks and upload cancellation

The upload cancellation now does not call abort request so the upload can be resumed in the future. The API could be modified to have cancel and cancel&abort methods.