Clean up file transfer code

Don't always unlock the media lock when a transfer is done