Added safety checks to Device.cpp so that if the a default device is
returned for an unknown (or not yet initialised) device then it will
avoid segfaulting.