final changes to pexpect.py and OSEHRAHelper for wait_re() functionality