title: Python multiprocessing - TypeError: 'Nonetype' object not callable
body: <p>I have encountered an issue with the Python multiprocessing library when using PySQLPool. It results in me getting the following exception: <code>'TypeError: 'NoneType' object is not callable'</code>.</p>
  
  <p>I create a Pool using multiprocessing, and call <code>Pool.map</code> on a dummy function. In the arguments to <code>map</code> I include a connection from PySQLPool. I have included the minimum code I could reproduce the bug with below:</p>
  
  <pre class="lang-py prettyprint-override"><code>from config import *
  import PySQLPool
  import multiprocessing as mp
  def a(b):
      return b
  PySQLPool.getNewPool().maxActiveConnections = 5
  connection = PySQLPool.getNewConnection(user=USER,
                      passwd=PASSWORD,
                      host='localhost',
                      db=DATABASE,
                      use_unicode=True,
                      charset='utf8',
                      commitOnEnd=False)
  pool = mp.Pool(processes=8)
  args = [(connection)]
  result_list = pool.map(a, args, 8)
  pool.close()
  pool.join()
  </code></pre>
  
  <p>It results in the following error:</p>
  
  <pre><code>Exception in thread Thread-2:
  Traceback (most recent call last):
    File "/root/.pyenv/versions/2.7.6/lib/python2.7/threading.py", line 810, in __bootstrap_inner
      self.run()
    File "/root/.pyenv/versions/2.7.6/lib/python2.7/threading.py", line 763, in run
      self.__target(*self.__args, **self.__kwargs)
    File "/root/.pyenv/versions/2.7.6/lib/python2.7/multiprocessing/pool.py", line 342, in _handle_tasks
      put(task)
  TypeError: 'NoneType' object is not callable
  </code></pre>
  
  <p>I have the following installed with pip</p>
  
  <pre><code>(venv)root@Ubuntu-1204-precise-64-minimal:/usr/share/python-multiproc/src# pip list
  MySQL-python (1.2.5)
  pip (6.0.8)
  PySQLPool (0.3.8)
  setuptools (12.0.5)
  </code></pre>
  
  <p>I have tested it on Ubuntu 12.04 with Python version 2.7.3, 2.7.6, and 2.7.9. Also tested on Windows 8 with Python 2.7.9. 
  Furthermore I have tried with both PySQLPool 0.3.8 and 0.4.</p>
  
  <p>What is the cause of this and how can I debug it?</p>