Rosemary Chicken with Mushrooms and Caramelized Onions