SDK Manager: fix bug that prevents from installing pkg updates. Do not merge.
Purely an UI issue, the Install button is not enabled
correctly for updates, thus preventing users from updating.
Patch 2: changed to have the same code used for both
enabling the buttons and actually selecting what to install
or delete. That will avoid inconsistencies.
Also prevented against a few potential NPEs.
(cherry picked from commit
7f0366ad3128d4911517f351d79e1bbea326c862)
Change-Id: I6cf5117409b5b5c70042f93a8f18723383748174