Hi,
In order to protect back USB keyboard connection I usual use a short USB cable to avoid too many in/out directly on the keyboard.
Probably you must to don't use that stick (connection or integrity of memory stick will be solved) change it.
If still have this problem, probably it is the keyboard (mother) connection.
If you use midis file keep them on the user memory, at least for out playing, you have space for a lot of files.
Regards
Mihai