tests: ensure log messages are always evaluated immediately

This is to work around the fact that nose delays evaluating the log
messages when log capturing is enabled, which can result in exceptions
like this if the log message tries to format an expired sqlalchemy
instance:

    Traceback (most recent call last):
      File "/usr/bin/nosetests", line 9, in <module>
        load_entry_point('nose==1.1.2', 'console_scripts', 'nosetests')()
      File "/usr/lib/python2.6/site-packages/nose/core.py", line 118, in __init__
        **extra_args)
      File "/usr/lib64/python2.6/unittest.py", line 816, in __init__
        self.runTests()
      File "/usr/lib/python2.6/site-packages/nose/core.py", line 197, in runTests
        result = self.testRunner.run(self.test)
      File "/usr/lib/python2.6/site-packages/nose/core.py", line 61, in run
        test(result)
      [...]
      File "/usr/lib/python2.6/site-packages/nose/case.py", line 138, in run
        result.addError(self, err)
      File "/usr/lib/python2.6/site-packages/nose/proxy.py", line 131, in addError
        formatted = plugins.formatError(self.test, err)
      File "/usr/lib/python2.6/site-packages/nose/plugins/manager.py", line 94, in __call__
        return self.call(*arg, **kw)
      File "/usr/lib/python2.6/site-packages/nose/plugins/manager.py", line 136, in chain
        result = meth(*arg, **kw)
      File "/usr/lib/python2.6/site-packages/nose/plugins/logcapture.py", line 223, in formatError
        test.capturedLogging = records = self.formatLogRecords()
      File "/usr/lib/python2.6/site-packages/nose/plugins/logcapture.py", line 231, in formatLogRecords
        return [safe_str(format(r)) for r in self.handler.buffer]
      File "/usr/lib64/python2.6/logging/__init__.py", line 654, in format
        return fmt.format(record)
      File "/usr/lib64/python2.6/logging/__init__.py", line 436, in format
        record.message = record.getMessage()
      File "/usr/lib64/python2.6/logging/__init__.py", line 306, in getMessage
        msg = msg % self.args
      File "/usr/lib/python2.6/site-packages/bkr/server/model.py", line 2982, in __repr__
        return '%s(name=%r)' % (self.__class__.__name__, self.name)
      File "/usr/lib64/python2.6/site-packages/sqlalchemy/orm/attributes.py", line 168, in __get__
        instance_dict(instance))
      File "/usr/lib64/python2.6/site-packages/sqlalchemy/orm/attributes.py", line 388, in get
        value = callable_(passive=passive)
      File "/usr/lib64/python2.6/site-packages/sqlalchemy/orm/state.py", line 287, in __call__
        self.manager.deferred_scalar_loader(self, toload)
      File "/usr/lib64/python2.6/site-packages/sqlalchemy/orm/mapper.py", line 2509, in _load_scalar_attributes
        state_str(state))
    sqlalchemy.orm.exc.ObjectDeletedError: Instance '<Distro at 0x525ed90>' has been deleted.

Also removed a very old workaround for sqlalchemy 0.4 that no longer
applies.

Change-Id: I0c6bd888ae3ad660bb965c861a08d195c67ec0c5
roll back creation of VirtResource if VM creation fails

Otherwise the VirtResource row will be committed even though the VM was
never created and the recipe was not moved to Scheduled. So it will end
up breaking later on, when queued_recipes tries to provision a real
system for it:

    2012-11-12 18:12:12,071 beakerd ERROR Failed to commit in queued_recipes
    Traceback (most recent call last):
      File "/usr/lib/python2.6/site-packages/bkr/server/tools/beakerd.py", line 391, in queued_recipes
        recipe.resource.allocate()
      File "/usr/lib/python2.6/site-packages/bkr/server/model.py", line 5964, in allocate
        reservation_type=u'recipe')
      File "/usr/lib/python2.6/site-packages/bkr/server/model.py", line 2452, in reserve
        session.flush()
      [...]
    IntegrityError: (IntegrityError) (1452, 'Cannot add or update a child row: a foreign key constraint fails (`beaker_devel/recipe_resource`, CONSTRAINT `recipe_resource_recipe_id_fk` FOREIGN KEY (`recipe_id`) REFERENCES `recipe` (`id`) ON DELETE CASCADE ON UPDATE CASCADE)') 'UPDATE recipe_resource SET recipe_id=%s WHERE recipe_resource.id = %s' (None, 12L)

Change-Id: I6e9cd94ad674549e3dff688e5d2d8be0e9426fb5