How do I deal with the edge tile?
You can't. You'll have to find another way to block off access. Sounds like you might be able to build a wall up to your moat; get creative!
You cannot dig or build on the edge tile, to prevent you from completely cutting yourself off from the world (for good or ill). Most people simply dig a most 4-10 tiles in from the edge of the map.