Revert "kernel: fix some leaks and cleanup" DERP

This reverts commit c641f2f9d46123172f35925dd09f839192776e32.