Add missing file truncate op for NIF mode

Plus a little unit test to make sure the file truncation operation
works.