Do you have a shoulder plane? If so you can get down close, then use the plane to get the thickness exactly right. Another thing I would consider doing is using a japanese pull saw to do the crosscut pretty much to depth, then use the router. That should eliminate any tearout since the bit won't have to touch the shoulder. I'd use that shoulder plane to creep up on the fit. If you're going to use glue, that's one thing, but if you want to break down or move the bedframe, you should consider a couple of pegs that you can push out to move the thing. Eventually, it will have to be broken down, so I just wouldn't use glue. My take on this anyhow.