if thread interrupted to abort a write, then remark the Thread as being interrupted before sending out the DeviceException

really should throw the InterruptedException explicitly but that is too big a job in a release branch
Merge branch 'gda-8.40' of ssh://dascgitolite@dasc-git.diamond.ac.uk/gda/gda-core.git into gda-8.40