RIYADH/JEDDAH, Saudi Arabia (Reuters) - BlackBerry maker Research In Motion has agreed to hand over coveted "codes" to users' phones to try to avert a ban on its Messenger service in Saudi Arabia, an industry source familiar with the talks told Reuters on Tuesday.