Measurement of the B+ and B0 meson lifetimes