Prevent getOffset from return an offset inside a content node

Browsers will always find a way to place the cursor at a strange
offset, but we should take care to not return a DM offset where
insertions can't take place.

Bug: 66691
Change-Id: I16baa0c67325d859ffe756f8d0e190758f2b9190