SOC-3610 [Upgrade] Failed to create portal container when upgrading from Platform 4.0.1

Fix description:
* Close the request lifecycle correctly during upgrade
SOC-3608, SOC-3609 [Upgrade] NPE of Activity Streams after upgrading from Platform 4.0.1

Fix description:
* Create an Identity Entity when a user has not any activity
* Check the existence of any space before executing SpaceActivityStreamUpgrade
Merge branch 'fix/4.0.x/SOC-3610' into stable/4.0.x
Merge commit 'aa578b75a20c65d982e731e7a50fdf962c46cfaa' into HEAD