Remove need to write screenshot to external storage.

Adding WRITE_EXTERNAL_STORAGE permission to an app might invalidate testing. So using an in-memory buffer instead.