Fix an error propagation bug when a command fails from bad inputs.

This fixes a bug where commands that had rejected promises as inputs
could not catch errors from those inputs. One example is trying to
catch a NoSuchElementError through a chained call to click:

driver.findElement(By.id('not-there')).click().thenCatch(function(e) {
if (e.code === NO_SUCH_ELEMENT) {
    // Handle element not found
}
});