(open_im): Return -1 if the input method has no state.