Add CheckFortranSourceCompiles module (#14656)

Copy the CheckCSourceCompiles module and port it to Fortran.
Extend the FortranOnly test to try using the new module.

Suggested-by: Nicolas Bock <nicolasbock@gmail.com>
Merge topic 'add-CheckFortranSourceCompiles' into next

c5e3c7c3 Add CheckFortranSourceCompiles module (#14656)