A time-dependent optimal harvesting problem with measure-valued solutions