[#1219] Add Twisted compatible checks for sync deferred.


Problem description
===================

Many of  the deferred that we are testing already have a result so we don't need ASync tests and we don't need to spin the reactor for getting the result.

In latest version of Twisted the following API was introduced.
http://twistedmatrix.com/documents/12.3.0/api/twisted.trial._synctest._Assertions.html

We want to use a similar API. This should improve performance and will make it much easier to reuse code between Twisted and our project.

The getDeferredResult method will only be used when working with threads and other async tests.


Changes description
===================

Add sync test api and test.


How to try and test the changes
===============================

reviewers @alibotean 

Check that changes make sense.