library fixes

minor fixes in the library part of the package
Revert "library fixes"

This reverts commit 1fe358ea7209b0e03976327c79a02e9e529d9c3a.
compliance with kernel > 3.3

headers have changed in kernel > 3.3 to let modify register cr0
safer handling of device file

now in case of error we release the device file correctly
scheduler_hook can be last function

When scheduler_hook was the last function compiled into the module, we
were not able to patch it. Now, since the module is loaded using free
pages, in this case we start looking for its ret from the end of the
page, removing the last change of failing to self-patch
safer scheduler patching

The scheduler patching should be safer now, and it's able to handle the
case as well of return instruction compiled in the middle of the
function.