Emergency care is in “dire” situation after loss of NHS beds, says royal college