Speeding up names()

Moved the allocation of the buffer ‘buf’ out of the loop. The buffer
size is hardcoded, an error is thrown if the buffer is too small.

This results in an almost 2x speedup for names().
flush(a) is also possible for a<:HDF5File