How do I add the "cancel" button to a managed file
if you redirect your browser I'm 99.9% sure it will cancel the upload.

how you handle that redirection is up to you.  I'd probably just show a hidden div when the upload starts with a Cancel upload

hopefully what I wrote above helps, but I'd like to mention the other alternative: 

don't put a cancel button in.  I would say that this is a useless "feature" and really why add things to your UI when you don't have to?

the user has to step through quite a few things, it'd be pretty odd if they selected the wrong file.