use slightly different criteria for keeping messages in memory

i basically just copied the java version here.

fixes https://github.com/rrbrambley/MessageBeast-ObjC/issues/39