build: update mozObjDir lookup code

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