For my cross stitch work, I machine stitch the edges all around with a zigzag (preferably a three-step). If by hand, I use a scaled down version of a blanket stitch. For something that will be washed, I would make the stitches closer though not as close as a buttonhole stitch.
As for worries about stitches coming loose, I have none. I learned as a youngster how to begin and end a stitching line (seam or embroidery) securely and invisibly (for nearly all items). I leave at least a needle's length of thread under an already stitched area, then stitch over where the needle came up about three times but not in the exact same place--angle your hand differently and use a different thread on the fabric each time. (Wish I had a picture; this sounds harder than it is.) I end the same way. I've used this technique on everything from wedding dresses to tents and never lost a bride or a camper.
This craftsy link may help with other ways to fasten your thread. https://www.craftsy.com/blog/2015/05/how-to-start-embroidery-without-a-knot/ These techniques are also fantastic.
Personally, I would stay away from any form of glue or tape. I've tried it in years past and found the results to be far less than satisfactory and unpleasant to work with during the stitching. And glue does deteriorate over time much faster than thread. And the sticky goop it leaves behind makes for a long cleaning story. ugh...