On Goodhart's law, with an application to value alignment