kmod/core: fix replace race condition

In the replace case, stop calling module_put on a patch module before
we're potentially done with it.

This will also be needed for future module patching if we want to
properly replace a patch module which only patches a future loaded
module (that's a mouthful).

Fixes #165.
kmod/core: support for patching of future loaded modules

This allows a patch module to contain patched functions for modules
which haven't been loaded yet.  If/when the module is loaded later, it
will be patched from the module notifier function.