Earlier quoted context omitted.
I run xlock on suspend rather than on resume, seems more reliable. I'm any case, locking is trivial to bypass by pressing Control-C a few times on resume to kill xorg, hence why I also start X with "startx; exit" so that this drops to the login prompt instead of the shell.
I think this still isn't secure. Try "sleep 5; exit" and press C-Z. You won't be logged out. You probably want to use "exec startx" instead.
Thank you, I took a look at my shell man page and this is very helpful.