hw/core/sysbus: Add a function for creating and attaching an object