More unit test fixes

- Fix TestGetImagesJSON when there is more than one image in the test
  repository;
- Remove an hardcoded constant use in TestGetImagesByName;
- Wait in a loop in TestKillDifferentUser;
- Use env instead of /usr/bin/env in TestEnv;
- Create a daemon user in contrib/mkimage-unittest.sh.

I think we are pretty close to something that finally works. Next steps are:

- clean up the docker-ut repository on the index (so older tests can continue to work, see #1072);
- switch to a new test image repository (I guess we can keep docker-unit-tests), with an updated image (so I can make a pull request for #33).