Prevent race conditions on ensureHost()

Use a schlock to make sure we don't try to write the same host in two
different lines of execution.
Pass hostname or Host object to Credentials

We have a couple of ways to get credentials; either with a Host object or a hostname.