Fix some double-frees/use-after-free

r? @frank-trampe
I understand that a kernel may be a little bit different, but I feel like you are biased against gotos in general. Braceless if blocks can be way more dangerous than gotos for instance (the [Apple SSL](http://nakedsecurity.sophos.com/2014/02/24/anatomy-of-a-goto-fail-apples-ssl-bug-explained-plus-an-unofficial-patch/) is an empirical proof). A goto with a label placed at the end of the function cannot be anymore dangerous than some other code styles in use in this repo like braceless one-liners blocks, or the fact that we use a language that does not have deterministic destruction. 
Anyways, I do not mean to make a big case over this, but I feel like we get a bit too much turned away from gotos in general.