1) Port into 2.0.x and 2.4.x kernels

2) Fix race conditions that may occur when module is unloaded from memory.
