receiver: Optimise a do { ... } while read loop

In create_image_id() we were reading in the file and hashing it to
create an ID for it by

    while (bytes_read > 0)

An optimisation we can do here is read/hash the file

    while (bytes_read == BUF_SIZE);

This will avoid an extra read of 0 and an extra call to mhash() except
when the file being read is a multiple of BUF_SIZE.

Signed-off-by: Andrew Clayton <andrew@opentechlabs.co.uk>
receiver: Optimise the do { ... } while read loop in main()

In main() we were reading in the email

    while (bytes_read > 0)

An optimisation we can do here is to read in the email

    while (bytes_read == BUF_SIZE)

Doing it this way means we can generally avoid an extra read of 0. The
only time we don't, is if the thing we are reading, is a multiple of
BUF_SIZE.

Signed-off-by: Andrew Clayton <andrew@opentechlabs.co.uk>