Fixed incompatibility issues with Mercurial

Mecurial's module "`demandimport`" delays imports form like "`import a, b.c`", cause Pyflakes was unable to distinguish Python 2 or 3. This patch changes the imports to immediate form "`__import__('a')`" to avoid this mechanism.

The bug can be 	reappeared with Hghooks 0.5.5 (https://pypi.python.org/pypi/hghooks/). With the hook `pretxncommit.pyflakes = python:hghooks.code.pyflakeshook` enabled, trying to commit this `.py` file will fail:

``` python
# -*- coding: utf-8 -*-

class Foo(object)
    bar = 1
```

The exception:

``` sh
philip@philip-Guokr:~/hgrepo/guokrplus$ hg ci -m "test"
error: pretxncommit.pyflakes hook raised an exception: 'ClassDef' object has no attribute 'keywords'
事务中止!
完成回滚
** unknown exception encountered, please report by visiting
**  http://mercurial.selenic.com/wiki/BugTracker
** Python 2.7.3 (default, Jan  2 2013, 13:56:14) [GCC 4.7.2]
** 分布式软件配置管理工具 - 水银 (版本 2.2.2)
** 已加载的扩展: convert, rebase, churn, purge, fetch, graphlog, progress
Traceback (most recent call last):
  File "/usr/bin/hg", line 38, in <module>
    mercurial.dispatch.run()
  File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 27, in run
    sys.exit((dispatch(request(sys.argv[1:])) or 0) & 255)
  File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 64, in dispatch
    return _runcatch(req)
  File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 87, in _runcatch
    return _dispatch(req)
  File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 696, in _dispatch
    cmdpats, cmdoptions)
  File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 472, in runcommand
    ret = _runcommand(ui, options, cmd, d)
  File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 786, in _runcommand
    return checkargs()
  File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 757, in checkargs
    return cmdfunc()
  File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 693, in <lambda>
    d = lambda: util.checksignature(func)(ui, *args, **cmdoptions)
  File "/usr/lib/python2.7/dist-packages/mercurial/util.py", line 463, in check
    return func(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/mercurial/commands.py", line 1279, in commit
    node = cmdutil.commit(ui, repo, commitfunc, pats, opts)
  File "/usr/lib/python2.7/dist-packages/mercurial/cmdutil.py", line 1294, in commit
    scmutil.match(repo[None], pats, opts), opts)
  File "/usr/lib/python2.7/dist-packages/mercurial/commands.py", line 1277, in commitfunc
    match, editor=e, extra=extra)
  File "/usr/lib/python2.7/dist-packages/mercurial/localrepo.py", line 1199, in commit
    ret = self.commitctx(cctx, True)
  File "/usr/lib/python2.7/dist-packages/mercurial/localrepo.py", line 1284, in commitctx
    parent2=xp2, pending=p)
  File "/usr/lib/python2.7/dist-packages/mercurial/localrepo.py", line 271, in hook
    return hook.hook(self.ui, self, name, throw, **args)
  File "/usr/lib/python2.7/dist-packages/mercurial/hook.py", line 173, in hook
    r = _pythonhook(ui, repo, name, hname, hookfn, args, throw) or r
  File "/usr/lib/python2.7/dist-packages/mercurial/hook.py", line 75, in _pythonhook
    r = obj(ui=ui, repo=repo, hooktype=name, **args)
  File "/usr/local/lib/python2.7/dist-packages/hghooks/code.py", line 186, in pyflakeshook
    return checker_manager.check(pyflakes_checker)
  File "/usr/local/lib/python2.7/dist-packages/hghooks/__init__.py", line 81, in check
    rev_warnings += checker(files_to_check, description)
  File "/usr/local/lib/python2.7/dist-packages/hghooks/code.py", line 177, in pyflakes_checker
    for filename, data in files_to_check.items()])
  File "/usr/local/lib/python2.7/dist-packages/hghooks/code.py", line 163, in pyflakes_check
    w = pyflakes.checker.Checker(tree, filename)
  File "/usr/local/lib/python2.7/dist-packages/pyflakes/checker.py", line 214, in __init__
    self.handleChildren(tree)
  File "/usr/local/lib/python2.7/dist-packages/pyflakes/checker.py", line 465, in handleChildren
    self.handleNode(node, tree)
  File "/usr/local/lib/python2.7/dist-packages/pyflakes/checker.py", line 489, in handleNode
    handler(node)
  File "/usr/local/lib/python2.7/dist-packages/pyflakes/checker.py", line 678, in CLASSDEF
    for keywordNode in node.keywords:
AttributeError: 'ClassDef' object has no attribute 'keywords'
```