After running lots of debug, I noticed that the simulate_ocean_modifier gets call multiples times, when it should probably only called when the modifier gets evaluated.
The cause for the crash seems that 2 or threads try to access the modifier that, I couldn't pin point the exact place where the 2 or more pools are created at the same, but this is visible when a long ocean operation occurs.
This patch removes two calls, one on init and another on copy. There are still one that can't be removed easily on set_height_normalize_factor.
Also move some of the variables on the simulation to be inside the mutex protection, and that seems to solve the crash.