kmod/core: improve performance for cumulative patching

When multiple patch modules patch the same function, there's no need to
patch all the intermediate functions.  Just hook them all into the
original function and use the ftrace handler to find the newest one.