Fix bug with page part deletion.

Due to recent jquery-ui version bump tabs widget api has changed
and we were still using old api.
Find proper id of active tab.
Add more checks to ensure proper page parts are deleted.
Merge pull request #2351 from refinery/issue_2349

Fix bug with page part deletion.