implement ticket #650: substitute PyErr_NoMemory() for 'raise MemoryError()'