Cache platform in FITS _array_to_file to improve speed on Mac

In #2317 I noticed that `TestImageFunctions::test_lossless_gzip_compression` in `astropy/io/fits/tests/test_image.py` is very slow on Mac (~12 seconds).

The problem is https://github.com/astropy/astropy/blob/master/astropy/io/fits/util.py#L600 where you introduced a call to `platform.architecture()` in #839.

This is called 2002 times by `TestImageFunctions::test_lossless_gzip_compression` and [platform.architecture()](https://docs.python.org/2/library/platform.html#platform.architecture) takes 5.3 milli-seconds on my Mac.

@embray I'm not sure what the best fix is here ... probably cache the platform somewhere?