pdTextBox: fix potential out of range errors for Alt+# input

Thank you to Zhu JY for this fix
pdTextBox: fix TAB beep on single-line instances

Thanks to Zhu JY for the fix