build: add checks to ensure mozupdate generates valid path names

(integrated from trunk branch change e339a7c by Todd Whiteman <toddw@activestate.com>)