Fix retention policy for functional and remote jobs of release builds (#473)

First patch to get the retention policy fixed for functional and remote jobs (see issue #473). @davehunt, can you please have a look at?