Fix loading add-ons in safemode

Signed-off-by: Philippe Saint-Pierre <stpere@gmail.com>
Fix Mismatching allocation and deallocation

Signed-off-by: Philippe Saint-Pierre <stpere@gmail.com>