The easiest way to avoid this problem is to make sure you turn off iMessage on your iPhone before you switch devices then you don't have this problem in the first place.
https://discussions.apple.com/thread/3392014?start=15&tstart...
https://discussions.apple.com/thread/3392014?start=15&tstart...
Moreover, before you sell your device or give it away, make sure you turn iMessage off.