Generate ERFA wrappers on-the-fly

(This is an alternative to https://github.com/astropy/astropy/pull/3166)

With this PR, which starts from one of @jwoillez's branches, ERFA files are generated on-the-fly, but only if any of the input files or scripts have been modified since the files were generated.

This does not require any changes to astropy-helpers and makes use of the current infrastructure.

I also made sure that ``sdist`` does not include the template files, and this also allows us to determine whether we are in release mode.

One change that could be made would be to just move the contents of ``cython_generate.py`` inside ``setup_package.py`` but I'll let @eteq decide on this.

cc @jwoillez @embray @mdboom @eteq @mhvk @taldcroft 
Agreed with @mdboom  that the template files should be in the release (if only to ensure the poor Debian packagers don't have to put it back ;-). If so, this `if` statement can be removed.