Don't put logs in ~/.opam when used as a library

This initialises the root dir in /tmp until opam's cl options are parsed.

Closes  #1355
(also includes small fix to #1352)
Fix opam-check for initialising opam-root
Merge pull request #1356 from OCamlPro/opam-installer-home

Don't put logs in ~/.opam when used as a library