Add Terminals.waitForChange implementation

Heavily inspired by the OpenJDK sun.security.smartcardio.PCSCTerminals
implementation