Change the way GEM_HOME is set in the Jar specs

This will hopefully work better in Travis.

This also fixes a small issue where @tmp_dir was used where a method argument should have been used.
Retry the bundling of the example app three times

Just like Travis does for the main bundling