I figured this one out, and can see why others did not reply.
The answer is right in the documentation:
Given a second vector argument, x, use that as the centers of the bins, with the width of the bins determined from the adjacent values in the vector.
Replace the first command with
octave:113> [nn,xx]=hist(p,[0:max(p)]);
and the histogram generated is exactly the one I was seeking.