MULE-6737: Application with IMAP connector doesn't undeploy

- Fixed concurrency problem on the RetrieveMessageReceiver when trying to undeploy an application.