Fix segfault when using shiboken.delete

When an object is deleted, invalidate / releaseWrapper needs to
be called before cptr array is deleted.

Change-Id: I82f71f569d5a0f52084fbe1cc3d7846e764c7ef6
Reviewed-by: John Cummings <jcummings2@users.sf.net>