Check if api_key is set in kwargs instead of checking for key

This fixes an issue when trying to connect to OpenStack using the nova module with a password. The nova module always adds 'api_key' to kwargs, but sets it to None if it isn't specified. This would result in the old check always being false and not setting the password to 'api_key'.