Fixed crash related to weak references

Technically, there are valid reasons why keyboardActiveInput could disappear before we could use it. For instance, in a sub view controller, the user enters text, then comes back (the input will be dealloced at this point) and then a non text input responder becomes active.