Introducing TemporaryBufferDevice

TemporaryBufferDevice acts as a somewhat smart buffer implementation,
which will by default buffer data in-memory at first, but will
automatically switch to a temporary file as storage after exceeding a
certain limit (as set by the user). By default, up to 4MiB are cached
in-memory.