I have found a solution!

Although the crash still happens frequently, I've found that all I need to do is unplug the piano (that is the USB connector to the MIDI device connected to the piano), and BIAB will exit.

I wish I'd found this years ago.

So, if you're having the same problem, try unplugging.