Constraint on the coupling of axionlike particles to matter via an ultracold neutron gravitational experiment