Stop NBServerTask properly

TNonblockingServer.close() should be called after
TNonblockingServer.stop()

from TNonblockingServer:

```
    def stop(self):
        """Stop the server.

        This method causes the serve() method to return.  stop() may be invoked
        from within your handler, or from another thread.

        After stop() is called, serve() will return but the server will still
        be listening on the socket.  serve() may then be called again to resume
        processing requests.  Alternatively, close() may be called after
        serve() returns to close the server socket and shutdown all worker
        threads.
        """
```

I didn't see a test for this under test/tasks/ so I added a dumbed down
version of the http_thrift.py demo. Manually tested by launching and
killing the service. Before this change:

```
(venv)08:34:54 (CLD-1282-sparts-prototype)
joeldodge@Joels-MacBook-Air-2.local:~/bronze_python
> python tnonblock_thrift.py --thrift-host 127.0.0.1 --thrift-port 9090
INFO:VService.NBServerTask:NBServerTask Server Started on 127.0.0.1:9090
DEBUG:VService:All tasks started
DEBUG:VService:VService Active.  Awaiting graceful shutdown.
^CINFO:VService:signal -2 received
INFO:VService:Received graceful shutdown request
ERROR:VService.NBServerTask:Unhandled exception in NBServerTask
Traceback (most recent call last):
  File "/Users/joeldodge/bronze_python/venv/lib/python2.7/site-packages/sparts/vtask.py", line 56, in _run
    self._runloop()
  File "/Users/joeldodge/bronze_python/venv/lib/python2.7/site-packages/sparts/tasks/thrift.py", line 61, in _runloop
    self.server.serve()
  File "/Users/joeldodge/bronze_python/venv/lib/python2.7/site-packages/thrift/server/TNonblockingServer.py", line 346, in serve
    self.handle()
  File "/Users/joeldodge/bronze_python/venv/lib/python2.7/site-packages/thrift/server/TNonblockingServer.py", line 306, in handle
    rset, wset, xset = self._select()
  File "/Users/joeldodge/bronze_python/venv/lib/python2.7/site-packages/thrift/server/TNonblockingServer.py", line 298, in _select
    return select.select(readable, writable, readable)
error: (9, 'Bad file descriptor')
INFO:VService:Waiting for tasks to shutdown gracefully...
INFO:VService:Received graceful shutdown request
DEBUG:VService:Waiting for <sparts.tasks.thrift.NBServerTask object at
0x10c693910> to stop...
DEBUG:VService.NBServerTask:Thread NBServerTask exited
DEBUG:VService:Waiting for <sparts.tasks.fb303.FB303ProcessorTask object
at 0x10c693810> to stop...
INFO:VService:Instance shut down gracefully
```

after this change:
```
(venv)08:34:34 (CLD-1282-sparts-prototype)
joeldodge@Joels-MacBook-Air-2.local:~/bronze_python
> python tnonblock_thrift.py --thrift-host 127.0.0.1 --thrift-port 9090
INFO:VService.NBServerTask:NBServerTask Server Started on 127.0.0.1:9090
DEBUG:VService:All tasks started
DEBUG:VService:VService Active.  Awaiting graceful shutdown.
^CINFO:VService:signal -2 received
INFO:VService:Received graceful shutdown request
INFO:VService:Waiting for tasks to shutdown gracefully...
DEBUG:VService:Waiting for <sparts.tasks.thrift.NBServerTask object at
0x100f61910> to stop...
DEBUG:VService.NBServerTask:Thread NBServerTask exited
DEBUG:VService:Waiting for <sparts.tasks.fb303.FB303ProcessorTask object
at 0x100f61810> to stop...
INFO:VService:Instance shut down gracefully
```
Merge pull request #46 from joeldodge79/nbservertask_shutdown_bug

Stop NBServerTask properly
Updated changelog
Misc base test tweaks

- use python2.7 unittest instead of unittest2?
- need ServiceTestCase subclasses to shutdown too

w/out this the tests never end... (at least using py.test)

ran tests with py.test:
```
Test session starts (darwin, 2.7.5)
plugins: sugar

―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― ERROR collecting externals/sparts/tests/tasks/test_queue_deferred.py ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
externals/sparts/tests/tasks/test_queue_deferred.py:8: in <module>
>       raise AssertionError("Twisted must be installed to run this test")
E       AssertionError: Twisted must be installed to run this test

――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― ERROR collecting externals/sparts/tests/tasks/test_tornado.py ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
externals/sparts/tests/tasks/test_tornado.py:1: in <module>
>   from sparts.tasks.tornado import TornadoIOLoopTask, TornadoHTTPTask
venv/lib/python2.7/site-packages/sparts/tasks/tornado.py:6: in <module>
>   import tornado.ioloop
E   ImportError: No module named tornado.ioloop

   externals/sparts/tests/test_vservice.py ✓                                                                                                                                                                                                                                                               11% ██████████
   externals/sparts/tests/tasks/test_file.py ✓✓✓                                                                                                                                                                                                                                                           38% ██████████
   externals/sparts/tests/tasks/test_periodic.py ✓✓                                                                                                                                                                                                                                                        63% ██████████
   externals/sparts/tests/tasks/test_poller.py ✓                                                                                                                                                                                                                                                           75% ██████████
   externals/sparts/tests/tasks/test_queue.py ✓✓                                                                                                                                                                                                                                                          100% ██████████

Results (5.54s):
   8 passed
```
Merge pull request #53 from joeldodge79/test_base_teardown

Misc base test tweaks
Import unittest2 as unittest and use this by default
More graceful test skipping

Create a skip exception compatible with both pytest and unittest2.
Use this to skip tests as appropriate
Make test case accessible on instantiated service
Encourage use of `mock` in unittests...

... by exporting the mock module as a property of the base test case.
If mock isn't installed, the test case will be skipped.
I fail at writing code

Return the mock after import, not after raising the exception...
/facepalm
Make test_file run faster

We only need the sleep in the modify test, not in the create test.  Move
this there.
Wrap os.stat in a method in DirectoryWatcher

So we can make this more easily mockable.
Faster QueueTask shutdown, better CPU usage

Currently, QueueTask polls the queue every 600ms, and checks for
shutdown events in-between.  This causes each queuetask-based test case
to take 600ms.

Instead of relying on the poll timeout, insert a sentinel object into
the queue on shutdown.  Check for the sentinel object, reinsert it, and
break if it's detected, so multi-worker queues can also shut down
gracefully.

As a result, I've decreased the polling interval from 600ms to 1.0s.  We
can probably increase this further, but will hold off for now unless
someone really needs this later on.

I've observed test case duration dropped from 600ms per test case to
12ms per test case.
Make PeriodicTask test much faster

before each test was taking ~500ms.  Now, both combined take 120ms.

Do this by explicitly tracking threads and polling the counter after
sleeping intervals of 100ms (and allowing for up to 3.0s to run) instead
of sleeping 500ms and *hoping* enough iterations had happened.
Make file test case pass more quickly

Explicitly pass a probably different mtime/atime for the utime call in
order to try to force an update sooner.

There's a small chance this could break things if the tmpfs doesn't
properly support utime, but that's highly unlikely.
Use pytest for unit tests.