JInstallerAdapterComponent bug fixes related to admin menu build

As requested by @wilsonge by email

# Executive summary

This patch for JInstallerAdapterComponent deals with issues manifesting themselves as "Can't build admin menus".

The following intertwined bug fixes are applied:
* If building admin menus failed the `#__menus` table was left broken (inconsistent lft/rgt) because rebuild() never ran against it.
* Failed installations without rollback (e.g. due to timeout) can leave behind rubbish `#__extensions` and `#__menus` entries leading to inability to reinstall the component
* A failure in _removeAdminMenus –presumably because of the issue above– would make it impossible to install the component.
* Just do not create the menu if $menuElement not exist (it was a TODO item for as long as I remember developing for Joomla!)
* The extension ID was passed to _buildAdminMenus but completely ignored!
* If a submenu already existed with the same parent item the installation would fail. Now we try removing it first, just like we do for the root menu item.

# Backwards compatibility

The protected _removeAdminMenus method has a different signature. To the best of my knowledge nobody extends JInstallerAdapterComponent directly, therefore the impact is non-existent.

# Translation impact

None

# Testing instructions

As I explained to @wislonge the problems only manifest themselves on bad hosting and when several things go wrong. As a result there is no way to do positive tests which reproduce the bugs. These are "blind" fixes. That said, I've been tracking down these issues since 2007 and applying workarounds on my own extensions ever since. I am pretty darn sure that my code DOES fix these issues.

As a result the only possible testing you can do is regression testing. Try applying this patch and install as many different components as you can on your site (but don't try my extensions, especially the pre-release versions, some have experimental fixes which will not work properly and override this patch in any case!). The installation should succeed and the components should be perfectly usable.