memory-device: add and use memory_device_get_region_size()