A novel nuclear emulsion detector for measurement of quantum states of ultracold neutrons in the Earth's gravitational field