SafeStream: added support for ftruncate