ib/core: init shared-pd ref count to 1, and add cleanup
When shpd is created it is already referred to by parent 'pd',
so shpd->shared should be '1' initially (and not '0');
otherwise, the 'shpd' memory may get freed/reallocated
while it is still being referred to by one last pd.
Additionally, add shared-pd cleanup to ucontext cleanup flow.
Orabug:
21496696
Signed-off-by: Arun Kaimalettu <arun.kaimalettu@oracle.com>
Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
(Ported from UEK2/OFED 1.5.5)
Signed-off-by: Mukesh Kacker <mukesh.kacker@oracle.com>