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 
This same thing is defined further down inside the line that starts with ``erfafns=``, so you can reuse it there (and you may also want to follow that and add ``ERFAPKGDIR`` as the starting point of the ``ERFA_SRC`` path - I'm not sure if that's necessary, but it might be safer?).