Fix issue with Ubuntu grub pre-install step for ARM

The Ubuntu build for ARM breaks when the pre-install step attempts to remove
grub components. This change gates those package removals based on whether
they are currently installed.

Change-Id: Ie169dbf12213e69b3713b3b1f9a68ae224f9fd31
Merge "Fix issue with Ubuntu grub pre-install step for ARM"