Determination of the optical bandgap of the Bernal and rhombohedral boron nitride polymorphs