Display message on HTTPException

Display the faultstring of HTTPException if available, such as
HTTPBadRequest(400) error and HTTPNotFound(404) error.

Change-Id: I1c361ff5d02ded4af429f94fd4299d2de3798488
Closes-bug: #1297769
Avoid dead loop when token is string format

The token needs to be a callable object in http.Client, so we assign
a lambda expression to it when it is a string, but current implementation
will cause dead loop since it is x = lambda: x. This patch fixes it
and improves the corresponding test code.

Change-Id: Id41edd705b46196404e5cb3483a290074bde12d0
Closes-Bug: #1301877
Merge "Display message on HTTPException"
Merge "Avoid dead loop when token is string format"