Prepare $PROMPT_COMMAND before appending to it.

Presence of commands in that variable, in MacOS X, caused my logic to
break. This now seems to be the right fix.