Improve synchronization and remove redundant vkDeviceWaitIdle calls.