amazon ec2: Make fetch-ec2-data more robust

curl does not retry if it is unable to connect to the metadata server.
For some reason, when creating a new AMI with a recent nixpkgs, the
metadata server would not be available when fetch-ec2-data ran. Switching
to wget that can retry even on TCP connection errors solved this problem.

I also made the fetch-ec2-data depend on ip-up.target, to get it to start
a bit later.

(cherry picked from commit 9fabd053585eb8ffa7c331bb7f1aeb4280c162ac)
virtualbox-image: Make the image size configurable

(cherry picked from commit ced7fc37c268e40e2c267fd2f1ad694b40f762e7)