Shape resonances in x-ray absorption spectra of a hexagonal boron nitride crystal