Handling SetPartitioner failure

Sometimes, when their is connection drop the `SetPartitioner` object fails to be created possibly due to `SessionExpiredError`. The object is set to FAILURE in that case. This way the client tries to create object again

Using internal `self._state` and manually getting state related properties that makes code more readable. Updated tests accordingly.