Final changes for #258.

When dealing with http expectations, check to see if we're writing a file and if so, set the content-length then as the FileBodyHandler invocation is delayed in this scenario.