rhbz998294 Avoid storing last upload part in database.

    This fixes an issue where the last part was not returning any
    bytes, and reduces unnecessary database activity.
rhbz998294 make upload chunk count calculation more explicit