ashmem_test: Split tests out into their own functions

In the future, after memfd is enabled, we want to make sure that
the existing tests work on ashmem fds, as those may still be used
by older applications. Therefore, split out the logic in the tests
so that the fd allocation can be done differently. This will allow
us to either allocate an fd through the libcutils library or from
the ashmem-memfd compatibility driver directly.

While we're here, do some stylistic clean up, such as marking
functions only used in this file as static.

No functional change.

Bug: 111903542
Change-Id: I2e06742333b093703f263c44c8e4f9e88e21a920
Signed-off-by: Isaac J. Manjarres <isaacmanjarres@google.com>
1 file changed