Folding bed mechanisms