Implement truncate

Fixes bradfitz/docker#8

Docker-DCO-1.1-Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com> (github: LK4D4)
Merge pull request #28 from LK4D4/implement_truncate_#8

Implement truncate