When do nanowires break? A model for the theoretical study of the long-term stability of monoatomic nanowires