Two Japanese tourists were detained in China following a "prank" at the Great Wall that sparked public outrage.