codegraph: allows -build to be run without X

Summary:
codegraph the UI needs X but codegraph -build should not
require X. Jiao has lots of issues with XQuartz with
his MAC and so can't even run codegraph -build. This
diff will fix that.

Test Plan:
$ ssh -X dev
$ cd pfff
$ ./codemap .
works
$ ./codegraph .
works
$ exit

$ ssh dev
$ cd ~/www/
$ ~/pfff/codegraph -build .
works

Reviewers: jiaol, pieter, mathieubaudet

Reviewed By: jiaol

CC: platform-diffs@lists

Differential Revision: https://phabricator.fb.com/D849071