Allow to throw an exception instead of aborting on assertion errors.

This is necessary to use Solarus as a library.