Ergodicity and type of nonsingular Bernoulli actions