I couldn't sleep and I looked at your problem a bit.
The issue is that apm lives in /usr/
sbin/, by default this isn't in the PATH with xsession.
Using a full path solves the issue.
*Waits for asem to slap his forehead and shout do'h*
Guess you can also use set/export but I keep forgetting how to use that
(Die hard csh user).
As a sidenote, I had some problems while testing with 10 different while loopsrunning in the background, so if you CTRL-ALT-BS or something like that remember to manually kill the sh instance running in the background.
Isn't there a better way do this with dwm?