Added memory check when consuming a message.

The consumer will be stopped if the available memory is not enough.

Fixed memory calcul.
Merge pull request #98 from blaugueux/memory-limit

Added memory check when consuming a message.