Assertion to verify that no function is patched twice.
Convenient debug line that may prove helpful in the future.
Fix references to patched functions.

When a function belonging to a module is patched, its copy in other
modules are not touched. This commit add a second scan of the modules
in order to spot such copies and fix them.