Move all opens in auth_token to be in context

This commit switches the use of open() to be in a with context. This
will prevent leaking file descriptors because using a context
provides an inherent close(). Prior to this commit it was possible
that an exception or error during the write() call could prevent
close() from running.

Change-Id: Ib13fe651d41f0eafea23a1c96c6c64d405de7e49
Merge "Move all opens in auth_token to be in context"