use a common function to find a free tile to spawn monster.

fix #10370