Fix AttributeError on Rack.resource_class_id for unassigned racks.

The racks that are not assigned to any resource class lack the
``resource_class_id`` attribute entirely, which makes the resource
class create and edit forms, as well as rack's edit form break when
there are any unassigned racks. This fixes it by using ``getattr`` when
accessing this attribute. An alternate approach would be to make sure
that a ``Rack` always has ``resource_class_id`` defined on it.

Change-Id: I6107930c0d60e26dda867768986b4ce81a4919a5
Merge "Fix AttributeError on Rack.resource_class_id for unassigned racks."