[bugfix] Allow "model" in model class name.

This PR implements the same methodology in `JModelLegacy::getName` as `JViewLegacy::getName`. Fixes tracker [#29015](http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&tracker_id=8103&tracker_item_id=29015)

This fixes an error where you wouldn't be able to have a model named `CarpenterModelRemodel` or `RemodelModelModels`.

The methodology to determine the name has been in use in `JViewLegacy::getName` for the past year without issue.