Better behaviour with 'opam pin edit'

Edit from a temp file rather than the real one, import file from
source even if it has errors (to let the user fix them), keep
the file formatting as-is when opam has no modifications to make

Fixes  #1613 (partially)
Closes  #1650
Merge pull request #1667 from OCamlPro/better-pin-edit

Better behaviour with 'opam pin edit'