Add maxsize option to ThreadedWrapperHandler

When put into a background thread, and the remote listener is offline, without a max size the queue here will leak memory.