Select mgs only if it's functional for non-MikTeX apps.

* preview.el (preview-gs-command): Test `mgs' for functionality
before using it.
Improve mgs check.

* preview.el (preview-gs-command): Better test if `mgs' is
working.