Java: Follow-up on httpclient & httpcore libraries update

In the upgraded httpclient & httpcore, the DefaultHttpClient is deprecated - switch to using a builder instead. Also avoid calling shutdown manually - the ClosableHttpClient + try with resource saves us this particular trouble.

The other changes are IntelliJ ones.