Use a std::shared_ptr to handle the lifetime of a module

The extremely rarely used case (used only by Fireworks) where a Looper modifies the parameters of a module had a memory problem due to inconsistent lifetime of a module. Switching to a std::shared_ptr rather than a bare pointer allows the lifetime to be correct. This bug was found by the address sanitizer.