Return the deferred object that $.ajax returns, or return null if websockets are used