Improve JGit isBareRepository implementation and add tests

Previous implementation ignored several cases which command line git handles.

There are still differences between the JGit and the CliGit
implementations, but the updated JGit implementation is a nearer
approximation to the CliGit implementation than the previous
implementation was.
Split isBareRepository tests to one assertion per test - faster diagnosis
Improve the diagnostics - no closer to consistency
Make JGitAPIImpl exception consistent with CliGit