Set the destroyed flag at the correct time and fix a the httpupload example to release all resources
Merge remote-tracking branch upstream/$:{upbranch}