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 
I realize you're doing this right now for testing, but in the end you might leave these in as ``distuitls.log.debug`` calls.