Allow mGerrit callers to specify initial gerrit instance

Also catch a potential null pointer

Change-Id: If21c96158fa699d6d19d9f2315e4a99710c0b897