Closes the receiver and stops listening for the messages.
The method must be called from the same thread which was used to create the receiver.