fix segfault when deleting portmidi