Don't validate skipped prompts

Fix mockPrompt so that `validate` is not called when `when` return
false. This makes the mocked behaviour consistent with Inquirer.js
and prevents test failures caused by `validate` functions not expecting
an undefined value.