Improve plutil error handling.

Now the reason for failure will be shown to the user since plutil
prints its error output to stdout instead of stderr.

Change-Id: I19c9a455503f086fe9b52545a8793c580e6c42ac
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Fix up file type detection code.

-b skips the filename in the output so we don't have to slice it off
(or fail miserably if a filename contains a colon).

Now we use MIME types (-I) as this should be more accurate, since JSON
identifies as a variety of things.

Change-Id: I6cc9249e9f44e0b5c17ea1deb7308b45033f6daa
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>