Improve receiveMessages() error and interrupt handling

CLDCONNECT-1424: This message source is now implemented asynchronously, which is why the `pollPeriod` parameter has been deprecated.

Also, we were using `!Thread.interrupted()` to know when to stop processing; this method resets the interrupt flag for the current thread, so it's useless in this case. `Thread.currentThread.isInterrupted()` does not reset the interrupt flag.