function disconnect(connection) {
    const client = getDatastoreClient(connection);
    return (client.disconnect) ?
        client.disconnect(connection).catch(logError) :
        Promise.resolve(connection);
}
disconnect closes the connection and
@param {object} connection Connection object
@returns {Promise} that resolves when the connection succeeds