Don't use MIT-SHM on remote displays.

When run from within 'ssh -X' or 'ssh -Y', MIT-SHM will appear to be
available even though it won't work: the shared memory will be on the
machine running vncviewer, not on the machine running the X server it
displays to. Depending on what shm segments are available on the
machine running the X server, the failure may not be apparent when
checking that MIT-SHM works.

Avoid this by not using MIT-SHM when XDisplayName() indicates we may
not be running locally.

Original bug report:
  https://bugzilla.redhat.com/show_bug.cgi?id=1072733
Check the return value from XShmAttach.
Merge branch 'remote-shm' of https://github.com/twaugh/tigervnc