How to attach a top plate to a plaster and lath ceiling for a closet?
It should be fairly easy to determine the direction the joists run. In older homes they almost always run across the short dimension of the home's footprint. Once you know that, and you have your walls laid out, just start drilling holes with a small bit through the plaster and lath until you find a joist. They should be on 16 inch centers from there. Simply run 3 inch construction screws through your plate, through the lath, and into the joist. You will not crush the plaster, but watch for signs of cracking as you tighten things up.

If you find that you have a wall running parallel to the joists and between them, you'll probably want to just glue the top plate in place. There shouldn't be very much sideways force on it anyway. I would use heavy duty construction adhesive and run a few screws into the lath to hold it in place while the adhesive sets. Plaster and lath is actually very strong and it's unlikely you'll do any damage this way if your wall framing fits snugly. Connect the ends of such walls securely into other walls or joists as you can and don't worry about it from there.

The right technique would have been to install blocking between joists while you had the plaster and lath out. Obviously it's too late for that now but it's not a big deal.