Fix thinko in self.middleware.cert_file_missing

The python function string.find() returns -1 on a miss,
which is also evaluated as True. Therefore use the
"X in Y" approach instead.

Also added a rather trivial test to test for this
code bug. In order to make the code easier to test,
I've changed the parameters to operate on the command
output, not the exception object and updated all callers.

Change-Id: If0b4fed6fe676cad50512267c1b601a3a8a631e5
Fix STALE_TOKEN_DURATION usage

Change-Id: I9856684d93d8b45310e599863553a020180aa509
Signed-off-by: Julien Danjou <julien@danjou.info>
Merge "Fix STALE_TOKEN_DURATION usage"
Merge "Fix thinko in self.middleware.cert_file_missing"