Model.getMessages will ignore custom validators if dijit is doing a live validation

reordered the if statements to check that the message is not a key to
a message in model.messages

this is useful as a temporary workaround as we can then add a custom
message to model.messages in the custom validator function and get our
error message displayed