Semiconcavity of the value function for an exit time problem with degenerate cost