Fix memory bugs related to the SO framework
Add a couple of minimal libshogun examples to study memory bugs