Better error checking for xdotool